[bcl] Remove more NET_2_0 checks from class libs
[mono.git] / mcs / class / corlib / Test / System.Collections / CaseInsensitiveComparerTest.cs
1 // CaseInsensitiveComparerTest
2
3 using System;
4 using System.Collections;
5 using System.Globalization;
6 using System.IO;
7 using System.Runtime.Serialization.Formatters;
8 using System.Runtime.Serialization.Formatters.Binary;
9 using System.Threading;
10
11 using NUnit.Framework;
12
13 namespace MonoTests.System.Collections {
14         [TestFixture]
15         public class CaseInsensitiveComparerTest {
16                 [Test]
17                 public void TestDefaultInstance ()
18                 {
19                         // Make sure the instance returned by Default
20                         // is really a CaseInsensitiveComparer.
21                         Assert.IsNotNull ((CaseInsensitiveComparer.Default as CaseInsensitiveComparer));
22                 }
23
24                 [Test]
25                 public void TestCompare ()
26                 {
27                         CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
28
29                         Assert.AreEqual (0, cic.Compare ("WILD WEST", "Wild West"));
30                         Assert.AreEqual (0, cic.Compare ("WILD WEST", "wild west"));
31                         Assert.AreEqual (1, cic.Compare ("Zeus", "Mars"));
32                         Assert.AreEqual (-1, cic.Compare ("Earth", "Venus"));
33                 }
34
35                 [Test]
36                 public void TestCompare_Culture ()
37                 {
38                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
39
40                         try {
41                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("tr-TR");
42
43                                 // the default ctor is initialized using Thread.CurrentCulture
44                                 CaseInsensitiveComparer cic = new CaseInsensitiveComparer ();
45                                 Assert.AreEqual (-1, cic.Compare ("I", "i"), "#A1");
46                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#A2");
47
48                                 // changing the current culture does not affect an already
49                                 // initialized CaseInsensitiveComparer
50                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
51                                 Assert.AreEqual (-1, cic.Compare ("I", "i"), "#B1");
52                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#B2");
53
54                                 // but it does affect new instances
55                                 cic = new CaseInsensitiveComparer ();
56                                 Assert.AreEqual (0, cic.Compare ("I", "i"), "#C1");
57                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#C2");
58
59                                 // if the culture is explicitly set, then the thread culture is
60                                 // ignored
61                                 cic = new CaseInsensitiveComparer (new CultureInfo ("tr-TR"));
62                                 Assert.AreEqual (-1, cic.Compare ("I", "i"), "#D1");
63                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#D2");
64                         } finally {
65                                 // restore original culture
66                                 Thread.CurrentThread.CurrentCulture = originalCulture;
67                         }
68                 }
69
70                 [Test]
71                 [Category ("NotWorking")] // bug #80076
72                 public void Default ()
73                 {
74                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
75
76                         try {
77                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("tr-TR");
78
79                                 // CaseInsensitiveComparer.Default is initialized using 
80                                 // Thread.CurrentCulture
81                                 CaseInsensitiveComparer cic = CaseInsensitiveComparer.Default;
82                                 Assert.AreEqual (-1, cic.Compare ("I", "i"), "#A1");
83                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#A2");
84
85                                 // changing the current culture does not affect an already
86                                 // initialized CaseInsensitiveComparer
87                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
88                                 Assert.AreEqual (-1, cic.Compare ("I", "i"), "#B1");
89                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#B2");
90
91                                 // but it does affect new instances
92                                 cic = CaseInsensitiveComparer.Default;
93                                 Assert.AreEqual (0, cic.Compare ("I", "i"), "#C1");
94                                 Assert.AreEqual (0, cic.Compare ("A", "a"), "#C2");
95                         } finally {
96                                 // restore original culture
97                                 Thread.CurrentThread.CurrentCulture = originalCulture;
98                         }
99                 }
100
101                 [Test]
102                 public void TestIntsNEq()
103                 {
104                         int a =1;
105                         int b =2;
106                         Assert.AreEqual (Comparer.Default.Compare (a, b), CaseInsensitiveComparer.Default.Compare (a, b));
107                 }
108                 
109                 [Test]
110                 public void TestIntsEq()
111                 {
112                         int a =1;
113                         int b =1;
114                         Assert.AreEqual (Comparer.Default.Compare (a, b), CaseInsensitiveComparer.Default.Compare(a, b));
115                 }
116
117                 [Test]
118                 [ExpectedException (typeof (ArgumentNullException))]
119                 public void CtorNull()
120                 {
121                         new CaseInsensitiveComparer(null);
122                 }
123
124                 [Test]
125                 [ExpectedException (typeof (ArgumentException))]
126                 public void TestObject()
127                 {
128                         object a = new object();
129                         object b = new object();
130                         CaseInsensitiveComparer.Default.Compare(a, b);
131                 }
132
133                 [Test]
134                 [ExpectedException (typeof (ArgumentException))]
135                 public void TestDiffArgs()
136                 {
137                         int a = 5;
138                         string b = "hola";
139                         CaseInsensitiveComparer.Default.Compare(a, b);
140                 }
141
142                 [Test]
143                 public void TestNull1()
144                 {
145                         string a = null;
146                         string b = "5";
147                         Assert.AreEqual (Comparer.Default.Compare (a, b), CaseInsensitiveComparer.Default.Compare (a, b));
148                 }
149
150                 [Test]
151                 public void TestNull2()
152                 {
153                         string a = null;
154                         string b = null;
155                         Assert.AreEqual (Comparer.Default.Compare (a, b), CaseInsensitiveComparer.Default.Compare (a, b));
156                 }
157                 
158                 [Test]
159                 public void TestStringsCaps()
160                 {
161                         string a = "AA";
162                         string b = "aa";
163                         Assert.AreEqual (0, CaseInsensitiveComparer.Default.Compare (a, b));
164                 }
165
166                 // CompareInfo does not have value for win32LCID field, and as a result
167                 // we have no perfect match
168                 [Test]
169                 [Category ("NotWorking")]
170                 public void Serialize_Culture ()
171                 {
172                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
173
174                         try {
175                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
176
177                                 BinaryFormatter bf = new BinaryFormatter ();
178                                 MemoryStream ms = new MemoryStream ();
179                                 bf.Serialize (ms, new CaseInsensitiveComparer (new CultureInfo ("tr-TR")));
180
181                                 byte [] buffer = new byte [ms.Length];
182                                 ms.Position = 0;
183                                 ms.Read (buffer, 0, buffer.Length);
184
185                                 Assert.AreEqual (_serializedCultureV20, buffer);
186                         } finally {
187                                 // restore original culture
188                                 Thread.CurrentThread.CurrentCulture = originalCulture;
189                         }
190                 }
191
192                 [Test]
193                 [Category ("NotWorking")] // bug #80082
194                 public void Deserialize_Culture ()
195                 {
196                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
197
198                         try {
199                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
200
201                                 MemoryStream ms = new MemoryStream ();
202                                 ms.Write (_serializedCultureV11, 0, _serializedCultureV11.Length);
203                                 ms.Position = 0;
204
205                                 BinaryFormatter bf = new BinaryFormatter ();
206                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer)
207                                         bf.Deserialize (ms);
208                                 Assert.IsNotNull (cic, "#1");
209
210                                 ms = new MemoryStream ();
211                                 ms.Write (_serializedCultureV20, 0, _serializedCultureV20.Length);
212                                 ms.Position = 0;
213
214                                 bf = new BinaryFormatter ();
215                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
216                                 Assert.IsNotNull (cic, "#2");
217                         } finally {
218                                 // restore original culture
219                                 Thread.CurrentThread.CurrentCulture = originalCulture;
220                         }
221                 }
222
223                 // CompareInfo does not have value for win32LCID field, and as a result
224                 // we have no perfect match
225                 [Test]
226                 [Category ("NotWorking")]
227                 public void Serialize_Default ()
228                 {
229                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
230
231                         try {
232                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
233
234                                 BinaryFormatter bf = new BinaryFormatter ();
235                                 MemoryStream ms = new MemoryStream ();
236                                 bf.Serialize (ms, CaseInsensitiveComparer.Default);
237
238                                 byte [] buffer = new byte [ms.Length];
239                                 ms.Position = 0;
240                                 ms.Read (buffer, 0, buffer.Length);
241
242                                 Assert.AreEqual (_serializedDefaultV20, buffer);
243                         } finally {
244                                 // restore original culture
245                                 Thread.CurrentThread.CurrentCulture = originalCulture;
246                         }
247                 }
248
249                 [Test]
250                 [Category ("NotWorking")] // bug #80082
251                 public void Deserialize_Default ()
252                 {
253                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
254
255                         try {
256                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
257
258                                 MemoryStream ms = new MemoryStream ();
259                                 ms.Write (_serializedDefaultV11, 0, _serializedDefaultV11.Length);
260                                 ms.Position = 0;
261
262                                 BinaryFormatter bf = new BinaryFormatter ();
263                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer) 
264                                         bf.Deserialize (ms);
265                                 Assert.IsNotNull (cic, "#1");
266
267                                 ms = new MemoryStream ();
268                                 ms.Write (_serializedDefaultV20, 0, _serializedDefaultV20.Length);
269                                 ms.Position = 0;
270
271                                 bf = new BinaryFormatter ();
272                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
273                                 Assert.IsNotNull (cic, "#2");
274                         } finally {
275                                 // restore original culture
276                                 Thread.CurrentThread.CurrentCulture = originalCulture;
277                         }
278                 }
279
280                 // CompareInfo does not have value for win32LCID field, and as a result
281                 // we have no perfect match
282                 [Test]
283                 [Category ("NotWorking")]
284                 public void Serialize_DefaultInvariant ()
285                 {
286                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
287
288                         try {
289                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
290
291                                 BinaryFormatter bf = new BinaryFormatter ();
292                                 MemoryStream ms = new MemoryStream ();
293                                 bf.Serialize (ms, CaseInsensitiveComparer.DefaultInvariant);
294
295                                 byte [] buffer = new byte [ms.Length];
296                                 ms.Position = 0;
297                                 ms.Read (buffer, 0, buffer.Length);
298
299                                 Assert.AreEqual (_serializedDefaultInvariantV20, buffer);
300                         } finally {
301                                 // restore original culture
302                                 Thread.CurrentThread.CurrentCulture = originalCulture;
303                         }
304                 }
305
306                 [Test]
307                 [Category ("NotWorking")] // bug #80082
308                 public void Deserialize_DefaultInvariant ()
309                 {
310                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
311
312                         try {
313                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
314
315                                 MemoryStream ms = new MemoryStream ();
316                                 ms.Write (_serializedDefaultInvariantV11, 0, _serializedDefaultInvariantV11.Length);
317                                 ms.Position = 0;
318
319                                 BinaryFormatter bf = new BinaryFormatter ();
320                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer)
321                                         bf.Deserialize (ms);
322                                 Assert.IsNotNull (cic, "#1");
323
324                                 ms = new MemoryStream ();
325                                 ms.Write (_serializedDefaultInvariantV20, 0, _serializedDefaultInvariantV20.Length);
326                                 ms.Position = 0;
327
328                                 bf = new BinaryFormatter ();
329                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
330                                 Assert.IsNotNull (cic, "#2");
331                         } finally {
332                                 // restore original culture
333                                 Thread.CurrentThread.CurrentCulture = originalCulture;
334                         }
335                 }
336
337                 private static byte [] _serializedDefaultV11 = new byte [] {
338                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
339                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
340                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
341                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
342                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
343                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
344                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
345                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
346                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
347                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
348                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
349                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
350                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
351                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
352                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
353                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
354                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x13,
355                         0x08, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, 0x0b };
356
357                 private static byte [] _serializedCultureV11 = new byte [] {
358                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
359                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
360                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
361                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
362                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
363                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
364                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
365                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
366                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
367                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
368                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
369                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
370                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
371                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
372                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
373                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
374                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x1f,
375                         0x04, 0x00, 0x00, 0x1f, 0x04, 0x00, 0x00, 0x0b };
376
377                 private static byte [] _serializedDefaultInvariantV11 = new byte [] {
378                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
379                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
380                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
381                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
382                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
383                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
384                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
385                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
386                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
387                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
388                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
389                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
390                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
391                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
392                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
393                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
394                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x7f,
395                         0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x0b };
396
397                 private static byte [] _serializedDefaultV20 = new byte [] {
398                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
399                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
400                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
401                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
402                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
403                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
404                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
405                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
406                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
407                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
408                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
409                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
410                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
411                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
412                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
413                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
414                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
415                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x13, 0x08, 0x00, 0x00,
416                         0x13, 0x08, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x05, 0x6e,
417                         0x6c, 0x2d, 0x42, 0x45, 0x0b };
418
419                 private static byte [] _serializedDefaultInvariantV20 = new byte [] {
420                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
421                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
422                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
423                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
424                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
425                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
426                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
427                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
428                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
429                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
430                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
431                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
432                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
433                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
434                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
435                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
436                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
437                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x7f, 0x00, 0x00, 0x00,
438                         0x7f, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b };
439
440                 private static byte [] _serializedCultureV20 = new byte [] {
441                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
442                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
443                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
444                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
445                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
446                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
447                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
448                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
449                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
450                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
451                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
452                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
453                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
454                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
455                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
456                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
457                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
458                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x1f, 0x04, 0x00, 0x00,
459                         0x1f, 0x04, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x05, 0x74,
460                         0x72, 0x2d, 0x54, 0x52, 0x0b };
461         }
462 }