2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / class / corlib / Test / System.Globalization / RegionInfoTest.cs
blobb3378553a5dedf6ac1e4d3c8c96346e6772ddb33
1 //
2 // System.Globalization.RegionInfoTest.cs
3 //
4 // Author:
5 // Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // (c) 2007 Novell, Inc. (http://www.novell.com)
8 //
10 using NUnit.Framework;
11 using System.IO;
12 using System;
13 using System.Globalization;
14 using System.Threading;
16 namespace MonoTests.System.Globalization
18 [TestFixture]
19 public class RegionInfoTest
21 [Test]
22 public void RegionByName ()
24 string [] names = new string [] {
25 "AR", "ES", "HK", "TW", "US"};
27 foreach (string name in names)
28 new RegionInfo (name);
32 [Test]
33 public void RegionByWrongName ()
35 string [] names = new string [] {
36 "en", "EN"};
38 foreach (string name in names) {
39 try {
40 new RegionInfo (name);
41 Assert.Fail ("should be invalid: " + name);
42 } catch (ArgumentException) {
47 [Test]
48 #if NET_2_0
49 #else
50 [ExpectedException (typeof (ArgumentException))]
51 #endif
52 public void RegionByLocaleName ()
54 string [] names = new string [] {
55 "en-US", "zh-TW"};
57 foreach (string name in names)
58 new RegionInfo (name);