2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / Test / System.Globalization / CultureInfoTest.cs
index 8691ce99ddf38e8fe61ae2f4e437ff0c4a0f8fca..5b6305c161a00f5d3f7399cccd38f27139c4f6d3 100644 (file)
@@ -11,6 +11,7 @@ using NUnit.Framework;
 using System.IO;
 using System;
 using System.Globalization;
+using System.Threading;
 
 namespace MonoTests.System.Globalization
 {
@@ -29,6 +30,23 @@ namespace MonoTests.System.Globalization
 
                        Assert ("InvariantCulture not found in the array from GetCultures()", false);
                }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void TrySetNeutralCultureNotInvariant ()
+               {
+                       Thread.CurrentThread.CurrentCulture = new CultureInfo ("ar");
+               }
+
+               [Test]
+               // make sure that all CultureInfo holds non-null calendars.
+               public void OptionalCalendars ()
+               {
+                       foreach (CultureInfo ci in CultureInfo.GetCultures (
+                               CultureTypes.AllCultures))
+                               AssertNotNull (String.Format ("{0} {1}",
+                                       ci.LCID, ci.Name), ci.OptionalCalendars);
+               }
        }
 }