Merge pull request #3106 from lambdageek/dev/monoerror-unhandled
[mono.git] / mcs / class / corlib / Test / System / TimeZoneInfoTest.cs
index ec5d1c975b39e243a2115751a63e6a154f8a848d..99a1f66a1f3fcb933e3ef2d1bec6f7da42d39370 100644 (file)
@@ -783,6 +783,7 @@ namespace MonoTests.System
                                Assert.IsTrue (timeZones.Count > 0, "GetSystemTimeZones should not return an empty collection.");
                        }
 
+#if !MOBILE
                        [Test]
                        public void WindowsRegistryTimezoneWithParentheses ()
                        {
@@ -791,6 +792,7 @@ namespace MonoTests.System
                                var name = method.Invoke (null, new object [] { " <--->  Central Standard Time (Mexico)   ||<<>>" });
                                Assert.AreEqual (name, "Central Standard Time (Mexico)", "#1");
                        }
+#endif
                }
                
                [TestFixture]
@@ -921,18 +923,18 @@ namespace MonoTests.System
                                        "Canada/Newfoundland",
                                        "Europe/Moscow",
                                        "Europe/Riga",
-                                       "N/A", // testing that the test doesn't fail with inexistent TZs
                                };
                                foreach (var tz in subMinuteDSTs) {
-                                       try {
-                                               TimeZoneInfo.FindSystemTimeZoneById (tz);
-                                       } catch (TimeZoneNotFoundException) {
-                                               // ok;
-                                       } catch (Exception ex) {
-                                               Assert.Fail (string.Format ("Failed to load TZ {0}: {1}", tz, ex.ToString ()));
-                                       }
+                                       TimeZoneInfo.FindSystemTimeZoneById (tz);
                                }
                        }
+
+                       [Test]
+                       [ExpectedException (typeof (TimeZoneNotFoundException))]
+                       public void InvalidName ()
+                       {
+                               TimeZoneInfo.FindSystemTimeZoneById ("N/A");
+                       }
                }
                
                [TestFixture]