Add Assert.Fail if no FormatException is thrown.
authorAdam Brengesjö <ca.brengesjo@gmail.com>
Wed, 13 Jun 2012 21:24:27 +0000 (23:24 +0200)
committerAdam Brengesjö <ca.brengesjo@gmail.com>
Wed, 13 Jun 2012 21:24:27 +0000 (23:24 +0200)
mcs/class/corlib/Test/System/DecimalTest.cs

index ef145ff11918cacc1212d56834ae85133b5c8557..87ddc5ec68d71703d133175d803d720904f576eb 100644 (file)
@@ -1482,8 +1482,10 @@ namespace MonoTests.System
                        try {
                                Decimal.Parse ("+15", nf);
                        } catch (FormatException) {
-                               // ok
+                               return;
                        }
+
+                       Assert.Fail ("Expected FormatException");
                }
 
                [Test] // bug #4814
@@ -1495,8 +1497,10 @@ namespace MonoTests.System
                        try {
                                Decimal.Parse ("-15", nf);
                        } catch (FormatException) {
-                               // ok
+                               return;
                        }
+
+                       Assert.Fail ("Expected FormatException");
                }
 
                [Test] // bug #4814
@@ -1508,8 +1512,10 @@ namespace MonoTests.System
                        try {
                                Decimal.Parse ("15+", nf);
                        } catch (FormatException) {
-                               // ok
+                               return;
                        }
+
+                       Assert.Fail ("Expected FormatException");
                }
 
                [Test] // bug #4814
@@ -1521,8 +1527,10 @@ namespace MonoTests.System
                        try {
                                Decimal.Parse ("15-", nf);
                        } catch (FormatException) {
-                               // ok
+                               return;
                        }
+
+                       Assert.Fail ("Expected FormatException");
                }
        }
 }