Merge pull request #963 from kebby/master
[mono.git] / mcs / class / System.XML / Test / System.Xml.Serialization / XmlSerializerImplementationTests.cs
index eca4e37f4ba786e4d373e789c183c3589f368fd0..368b63bdbf76bcc1b2a0133922eced41491a1bba 100644 (file)
@@ -30,6 +30,7 @@
 
 #if NET_2_0
 using System;
+using System.Collections;
 using System.Xml.Serialization;
 
 using NUnit.Framework;
@@ -98,6 +99,24 @@ namespace MonoTests.System.XmlSerialization
                        MyImplementation impl = new MyImplementation ();
                        Assert.IsNull (impl.GetSerializer (typeof (int)), "#1");
                }
+
+               [Test]
+               [ExpectedException (typeof (NotSupportedException))]
+               public void GetSerializer2 ()
+               {
+                       MyImplementation2 impl = new MyImplementation2 ();
+                       impl.TypedSerializers [typeof (int)] = new XmlSerializer (typeof (int));
+                       XmlSerializer ser = impl.GetSerializer (typeof (int));
+               }
+
+               class MyImplementation2 : XmlSerializerImplementation
+               {
+                       Hashtable serializers = new Hashtable ();
+
+                       public override Hashtable TypedSerializers {
+                               get { return serializers; }
+                       }
+               }
        }
 }
 #endif