X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Drawing%2FTest%2FSystem.Drawing%2FTestRectangleConverter.cs;h=9a9176339786cca19b01417588c37c083c594bb1;hb=90d6059c5475419ddf6e0fc4b49098158010cab0;hp=459418b395caea7433e89d580dc79275f4be95a6;hpb=096265478e6e4145c90250a5bf78c0c179ee50af;p=mono.git diff --git a/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs b/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs index 459418b395c..9a917633978 100644 --- a/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs +++ b/mcs/class/System.Drawing/Test/System.Drawing/TestRectangleConverter.cs @@ -308,18 +308,22 @@ namespace MonoTests.System.Drawing rectInstance = (Rectangle) rconv.CreateInstance (null, ht); Assert.AreEqual (rectneg, rectInstance, "CI#2"); + } - // Property names are case-sensitive. It should throw - // NullRefExc if any of the property names does not match - ht.Clear (); - ht.Add ("x", -10); ht.Add ("Y", -10); - ht.Add ("Width", 20); ht.Add ("Height", 30); - try { - rectInstance = (Rectangle) rconv.CreateInstance (null, ht); - Assert.Fail ("CI#3: must throw NullReferenceException"); - } catch (Exception e) { - Assert.IsTrue (e is NullReferenceException, "CI#3"); - } + [Test] +#if NET_2_0 + [ExpectedException (typeof (ArgumentException))] +#else + [ExpectedException (typeof (NullReferenceException))] +#endif + public void TestCreateInstance_CaseSensitive () + { + Hashtable ht = new Hashtable (); + ht.Add ("x", -10); + ht.Add ("Y", -10); + ht.Add ("Width", 20); + ht.Add ("Height", 30); + rconv.CreateInstance (null, ht); } [Test]