Make System.Drawing unit tests use Assert.Throws instead of [ExpectedException] ...
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestSizeConverter.cs
index 7e10230544ae01cc9e83d2776640e34d491235a4..03a986cea8aa67e43bc07928b04cce92a4ecac23 100644 (file)
@@ -256,13 +256,12 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
-               [ExpectedException (typeof (ArgumentException))]
                public void TestCreateInstance_CaseSensitive ()
                {
                        Hashtable ht = new Hashtable ();
                        ht.Add ("width", 20);
                        ht.Add ("Height", 30);
-                       szconv.CreateInstance (null, ht);
+                       Assert.Throws<ArgumentException> (() => szconv.CreateInstance (null, ht));
                }
 
                [Test]
@@ -310,10 +309,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
-               [ExpectedException (typeof (ArgumentException))]
                public void ConvertFromInvariantString_string_exc_1 ()
                {
-                       szconv.ConvertFromInvariantString ("1, 2, 3");
+                       Assert.Throws<ArgumentException> (() => szconv.ConvertFromInvariantString ("1, 2, 3"));
                }
 
                [Test]
@@ -346,12 +344,11 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
-               [ExpectedException (typeof (ArgumentException))]
                public void ConvertFromString_string_exc_1 ()
                {
                        CultureInfo culture = CultureInfo.CurrentCulture;
-                       szconv.ConvertFromString (string.Format(culture,
-                               "1{0} 2{0} 3{0} 4{0} 5", culture.TextInfo.ListSeparator));
+                       Assert.Throws<ArgumentException> (() => szconv.ConvertFromString (string.Format(culture,
+                               "1{0} 2{0} 3{0} 4{0} 5", culture.TextInfo.ListSeparator)));
                }
 
                [Test]