[corlib] Throw correct exception for missing properties called via InvokeMember
[mono.git] / mcs / class / corlib / Test / System / TypeTest.cs
index 9c1f8d950091ec4e7b84f5b00a8deaa18185934c..85c3542f0e152c8a7ae120185354895665c0b505 100644 (file)
@@ -1692,21 +1692,6 @@ namespace MonoTests.System
                        Assert.IsTrue (typeof (TimeSpan).IsValueType, "#6");
                }
 
-               [Test]
-               [Category("NotDotNet")]
-               // Depends on the GAC working, which it doesn't durring make distcheck.
-               [Category ("NotWorking")]
-               public void GetTypeWithWhitespace ()
-               {
-                       Assert.IsNotNull (Type.GetType
-                                                  (@"System.Configuration.NameValueSectionHandler,
-                       System,
-Version=1.0.5000.0,
-Culture=neutral
-,
-PublicKeyToken=b77a5c561934e089"));
-               }
-
                [Test]
                public void GetTypeNonVectorArray ()
                {
@@ -1886,6 +1871,20 @@ PublicKeyToken=b77a5c561934e089"));
                        typeof(B).InvokeMember ("", BindingFlags.CreateInstance, null, null, new object [] { 1 });
                }
 
+               [Test]
+               [ExpectedException (typeof (MissingMethodException))]
+               public void InvokeGetPropertyMissing ()
+               {
+                       typeof(B).InvokeMember ("", BindingFlags.GetProperty, null, null, new object [] { 1 });
+               }
+
+               [Test]
+               [ExpectedException (typeof (MissingMethodException))]
+               public void InvokeSetPropertyMissing ()
+               {
+                       typeof(B).InvokeMember ("", BindingFlags.SetProperty, null, null, new object [] { 1 });
+               }
+
                internal static string bug336841 (string param1, params string [] param2)
                {
                        StringBuilder sb = new StringBuilder ();
@@ -3211,6 +3210,14 @@ PublicKeyToken=b77a5c561934e089"));
                        Assert.AreEqual (t1, t2);
                }
 
+#if !MONOTOUCH
+               [Test]
+               public void SpaceAfterComma () {
+                       string strType = "System.Collections.Generic.Dictionary`2[[System.Int32,mscorlib], [System.String,mscorlib]],mscorlib";
+                       Assert.IsTrue (Type.GetType (strType) != null);
+               }
+#endif
+
 #if !MONOTOUCH
                [Test]
                public void Bug506757 ()