merged Sys.Web.Services 2.0 support in my branch:
[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 #if NET_2_0
186                                 Assert.AreEqual (_serializedCultureV20, buffer);
187 #else
188                                 Assert.AreEqual (_serializedCultureV11, buffer);
189 #endif
190                         } finally {
191                                 // restore original culture
192                                 Thread.CurrentThread.CurrentCulture = originalCulture;
193                         }
194                 }
195
196                 [Test]
197 #if NET_2_0
198                 [Category ("NotWorking")] // bug #80082
199 #else
200                 [Category ("NotWorking")] // bug #80076
201 #endif
202                 public void Deserialize_Culture ()
203                 {
204                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
205
206                         try {
207                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
208
209                                 MemoryStream ms = new MemoryStream ();
210                                 ms.Write (_serializedCultureV11, 0, _serializedCultureV11.Length);
211                                 ms.Position = 0;
212
213                                 BinaryFormatter bf = new BinaryFormatter ();
214                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer)
215                                         bf.Deserialize (ms);
216                                 Assert.IsNotNull (cic, "#1");
217
218 #if NET_2_0
219                                 ms = new MemoryStream ();
220                                 ms.Write (_serializedCultureV20, 0, _serializedCultureV20.Length);
221                                 ms.Position = 0;
222
223                                 bf = new BinaryFormatter ();
224                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
225                                 Assert.IsNotNull (cic, "#2");
226 #endif
227                         } finally {
228                                 // restore original culture
229                                 Thread.CurrentThread.CurrentCulture = originalCulture;
230                         }
231                 }
232
233                 // CompareInfo does not have value for win32LCID field, and as a result
234                 // we have no perfect match
235                 [Test]
236                 [Category ("NotWorking")]
237                 public void Serialize_Default ()
238                 {
239                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
240
241                         try {
242                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
243
244                                 BinaryFormatter bf = new BinaryFormatter ();
245                                 MemoryStream ms = new MemoryStream ();
246                                 bf.Serialize (ms, CaseInsensitiveComparer.Default);
247
248                                 byte [] buffer = new byte [ms.Length];
249                                 ms.Position = 0;
250                                 ms.Read (buffer, 0, buffer.Length);
251
252 #if NET_2_0
253                                 Assert.AreEqual (_serializedDefaultV20, buffer);
254 #else
255                                 Assert.AreEqual (_serializedDefaultV11, buffer);
256 #endif
257                         } finally {
258                                 // restore original culture
259                                 Thread.CurrentThread.CurrentCulture = originalCulture;
260                         }
261                 }
262
263                 [Test]
264 #if NET_2_0
265                 [Category ("NotWorking")] // bug #80082
266 #else
267                 [Category ("NotWorking")] // bug #80076
268 #endif
269                 public void Deserialize_Default ()
270                 {
271                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
272
273                         try {
274                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
275
276                                 MemoryStream ms = new MemoryStream ();
277                                 ms.Write (_serializedDefaultV11, 0, _serializedDefaultV11.Length);
278                                 ms.Position = 0;
279
280                                 BinaryFormatter bf = new BinaryFormatter ();
281                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer) 
282                                         bf.Deserialize (ms);
283                                 Assert.IsNotNull (cic, "#1");
284
285 #if NET_2_0
286                                 ms = new MemoryStream ();
287                                 ms.Write (_serializedDefaultV20, 0, _serializedDefaultV20.Length);
288                                 ms.Position = 0;
289
290                                 bf = new BinaryFormatter ();
291                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
292                                 Assert.IsNotNull (cic, "#2");
293 #endif
294                         } finally {
295                                 // restore original culture
296                                 Thread.CurrentThread.CurrentCulture = originalCulture;
297                         }
298                 }
299
300                 // CompareInfo does not have value for win32LCID field, and as a result
301                 // we have no perfect match
302                 [Test]
303                 [Category ("NotWorking")]
304                 public void Serialize_DefaultInvariant ()
305                 {
306                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
307
308                         try {
309                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
310
311                                 BinaryFormatter bf = new BinaryFormatter ();
312                                 MemoryStream ms = new MemoryStream ();
313                                 bf.Serialize (ms, CaseInsensitiveComparer.DefaultInvariant);
314
315                                 byte [] buffer = new byte [ms.Length];
316                                 ms.Position = 0;
317                                 ms.Read (buffer, 0, buffer.Length);
318
319 #if NET_2_0
320                                 Assert.AreEqual (_serializedDefaultInvariantV20, buffer);
321 #else
322                                 Assert.AreEqual (_serializedDefaultInvariantV11, buffer);
323 #endif
324                         } finally {
325                                 // restore original culture
326                                 Thread.CurrentThread.CurrentCulture = originalCulture;
327                         }
328                 }
329
330                 [Test]
331 #if NET_2_0
332                 [Category ("NotWorking")] // bug #80082
333 #else
334                 [Category ("NotWorking")] // bug #80076
335 #endif
336                 public void Deserialize_DefaultInvariant ()
337                 {
338                         CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
339
340                         try {
341                                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("nl-BE");
342
343                                 MemoryStream ms = new MemoryStream ();
344                                 ms.Write (_serializedDefaultInvariantV11, 0, _serializedDefaultInvariantV11.Length);
345                                 ms.Position = 0;
346
347                                 BinaryFormatter bf = new BinaryFormatter ();
348                                 CaseInsensitiveComparer cic = (CaseInsensitiveComparer)
349                                         bf.Deserialize (ms);
350                                 Assert.IsNotNull (cic, "#1");
351
352 #if NET_2_0
353                                 ms = new MemoryStream ();
354                                 ms.Write (_serializedDefaultInvariantV20, 0, _serializedDefaultInvariantV20.Length);
355                                 ms.Position = 0;
356
357                                 bf = new BinaryFormatter ();
358                                 cic = (CaseInsensitiveComparer) bf.Deserialize (ms);
359                                 Assert.IsNotNull (cic, "#2");
360 #endif
361                         } finally {
362                                 // restore original culture
363                                 Thread.CurrentThread.CurrentCulture = originalCulture;
364                         }
365                 }
366
367                 private static byte [] _serializedDefaultV11 = new byte [] {
368                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
369                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
370                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
371                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
372                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
373                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
374                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
375                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
376                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
377                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
378                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
379                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
380                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
381                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
382                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
383                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
384                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x13,
385                         0x08, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, 0x0b };
386
387                 private static byte [] _serializedCultureV11 = new byte [] {
388                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
389                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
390                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
391                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
392                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
393                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
394                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
395                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
396                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
397                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
398                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
399                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
400                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
401                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
402                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
403                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
404                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x1f,
405                         0x04, 0x00, 0x00, 0x1f, 0x04, 0x00, 0x00, 0x0b };
406
407                 private static byte [] _serializedDefaultInvariantV11 = new byte [] {
408                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
409                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
410                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
411                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
412                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
413                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
414                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
415                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
416                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
417                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
418                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
419                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
420                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
421                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
422                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x02, 0x00, 0x00, 0x00, 0x09,
423                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
424                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x00, 0x00, 0x08, 0x08, 0x7f,
425                         0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x0b };
426
427 #if NET_2_0
428                 private static byte [] _serializedDefaultV20 = new byte [] {
429                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
430                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
431                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
432                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
433                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
434                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
435                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
436                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
437                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
438                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
439                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
440                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
441                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
442                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
443                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
444                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
445                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
446                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x13, 0x08, 0x00, 0x00,
447                         0x13, 0x08, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x05, 0x6e,
448                         0x6c, 0x2d, 0x42, 0x45, 0x0b };
449
450                 private static byte [] _serializedDefaultInvariantV20 = new byte [] {
451                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
452                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
453                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
454                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
455                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
456                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
457                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
458                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
459                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
460                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
461                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
462                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
463                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
464                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
465                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
466                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
467                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
468                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x7f, 0x00, 0x00, 0x00,
469                         0x7f, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0b };
470
471                 private static byte [] _serializedCultureV20 = new byte [] {
472                         0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
473                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00,
474                         0x2a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x43, 0x6f, 0x6c,
475                         0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x61,
476                         0x73, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
477                         0x76, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x72, 0x01,
478                         0x00, 0x00, 0x00, 0x0d, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61,
479                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x20, 0x53, 0x79, 0x73,
480                         0x74, 0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69,
481                         0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70,
482                         0x61, 0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x09, 0x02, 0x00, 0x00,
483                         0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x20, 0x53, 0x79, 0x73, 0x74,
484                         0x65, 0x6d, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x69, 0x7a,
485                         0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61,
486                         0x72, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x03, 0x00, 0x00, 0x00, 0x09,
487                         0x77, 0x69, 0x6e, 0x33, 0x32, 0x4c, 0x43, 0x49, 0x44, 0x07, 0x63,
488                         0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x06, 0x6d, 0x5f, 0x6e, 0x61,
489                         0x6d, 0x65, 0x00, 0x00, 0x01, 0x08, 0x08, 0x1f, 0x04, 0x00, 0x00,
490                         0x1f, 0x04, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x05, 0x74,
491                         0x72, 0x2d, 0x54, 0x52, 0x0b };
492 #endif
493         }
494 }