Add a test for the regression to Delegate.CreateDelegate triggered by 2ec0ab59fe4aecf...
authorJb Evain <jbevain@gmail.com>
Thu, 2 Sep 2010 13:58:20 +0000 (15:58 +0200)
committerJb Evain <jbevain@gmail.com>
Thu, 2 Sep 2010 13:58:20 +0000 (15:58 +0200)
mcs/class/corlib/Test/System/DelegateTest.cs

index 966a3d61ca1173bf347197846fb792df1321743a..45da0971b67af81453a3800a5ebc579206809b91 100644 (file)
@@ -1084,6 +1084,19 @@ namespace MonoTests.System
                        bar_handler += foo.Bar;
                }
 
+               public void Banga ()
+               {
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentException))]
+               public void CreateDelegateOpenOnly ()
+               {
+                       Delegate.CreateDelegate (
+                               typeof (Action),
+                               this.GetType ().GetMethod ("Banga"));
+               }
+
 #endif
 
                [Test]