Merge pull request #273 from joncham/bug-getpid
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestRectangleConverter.cs
index 92f93f9a9957ad3a92ce05de7a88bc79fb3fb0bc..9a9176339786cca19b01417588c37c083c594bb1 100644 (file)
@@ -34,6 +34,7 @@ using System.ComponentModel;
 using System.ComponentModel.Design.Serialization;
 using System.Drawing;
 using System.Globalization;
+using System.Security.Permissions;
 using System.Threading;
 
 using NUnit.Framework;
@@ -41,6 +42,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Drawing
 {
        [TestFixture]
+       [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
        public class RectangleConverterTest
        {
                Rectangle rect;
@@ -67,6 +69,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void TestCanConvertFrom ()
                {
                        Assert.IsTrue (rconv.CanConvertFrom (typeof (String)), "CCF#1");
@@ -98,6 +103,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void TestConvertFrom ()
                {
                        Assert.AreEqual (rect, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
@@ -300,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]
@@ -322,6 +334,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void TestGetProperties ()
                {
                        Attribute [] attrs;
@@ -379,6 +394,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void ConvertFromInvariantString_string_exc_2 ()
                {
                        try {
@@ -392,6 +410,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void ConvertFromString_string ()
                {
                        // save current culture
@@ -417,6 +438,9 @@ namespace MonoTests.System.Drawing
                }
 
                [Test]
+#if TARGET_JVM
+               [NUnit.Framework.Category ("NotWorking")]
+#endif
                public void ConvertFromString_string_exc_2 ()
                {
                        try {