In System:
[mono.git] / mcs / class / corlib / Test / System / RuntimeMethodHandleTest.cs
index 124f9422e0a08de0d856894f9a3b3370438d390f..e7c1f70badfc44191043841bcb25a9e837e6f4ed 100644 (file)
@@ -27,6 +27,9 @@
 //
 
 using System;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
 
 using NUnit.Framework;
 
@@ -98,5 +101,13 @@ namespace MonoTests.System
                        Assert.IsTrue (rmhB1 != rmhA1, "#B6");
                }
 #endif
+
+               [Test]
+               [ExpectedException (typeof (SerializationException))]
+               public void Serialization_Of_Empty_Handle ()
+               {
+                       RuntimeMethodHandle handle = new RuntimeMethodHandle ();
+                       new BinaryFormatter ().Serialize (Stream.Null, handle);
+               }
        }
 }