Add not-working tets for some MarkupExtension wrapper types.
[mono.git] / mcs / class / System.Xaml / Test / System.Xaml / XamlObjectWriterTest.cs
index ceda7bcca9ebe82d956030ab1af7f3b96e6dc71d..787a9f37228521f8c37d4bb139be9b478b87837b 100755 (executable)
@@ -249,9 +249,6 @@ namespace MonoTests.System.Xaml
                        // passes here, but ...
                        xw.WriteValue ("foo");
                        // rejected here, unlike XamlXmlWriter.
-                       //
-                       // Basically, assume that no content could be written 
-                       // for an object member within XamlObjectWriter.
                        xw.WriteEndMember ();
                }
 
@@ -285,7 +282,6 @@ namespace MonoTests.System.Xaml
 
                [Test]
                [ExpectedException (typeof (XamlDuplicateMemberException))]
-               [Category ("NotWorking")]
                public void DuplicateAssignment2 ()
                {
                        var xw = new XamlObjectWriter (sctx, null);
@@ -337,6 +333,7 @@ namespace MonoTests.System.Xaml
 
                [Test]
                // This behavior is different from XamlXmlWriter. Compare to XamlXmlWriterTest.WriteValueList().
+               [Category ("NotWorking")] // not worthy of passing
                public void WriteValueList ()
                {
                        var xw = new XamlObjectWriter (sctx, null);
@@ -539,7 +536,7 @@ namespace MonoTests.System.Xaml
                }
 
                [Test]
-               [Category ("NotWorking")]
+               [Category ("NotWorking")] // not worthy of passing
                public void StartMemberBeforeNamespace ()
                {
                        var xw = new XamlObjectWriter (sctx, null);
@@ -599,7 +596,6 @@ namespace MonoTests.System.Xaml
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void GetObjectOnIntValue ()
                {
                        var xw = new XamlObjectWriter (sctx, null);
@@ -811,9 +807,18 @@ namespace MonoTests.System.Xaml
                        }
                }
 
+               [Test]
+               public void Write_GuidFactoryMethod ()
+               {
+                       var obj = Guid.Parse ("9c3345ec-8922-4662-8e8d-a4e41f47cf09");
+                       using (var xr = GetReader ("GuidFactoryMethod.xml")) {
+                               var des = XamlServices.Load (xr);
+                               Assert.AreEqual (obj, des, "#1");
+                       }
+               }
+
                [Test]
                [ExpectedException (typeof (XamlObjectWriterException))] // cannot resolve the StaticExtension value.
-               [Category ("NotWorking")]
                public void Write_StaticExtension ()
                {
                        var obj = new StaticExtension ("FooBar");
@@ -888,7 +893,6 @@ namespace MonoTests.System.Xaml
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void Write_DictionaryInt32String ()
                {
                        var dic = new Dictionary<int,string> ();
@@ -902,7 +906,6 @@ namespace MonoTests.System.Xaml
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void Write_DictionaryStringType ()
                {
                        var dic = new Dictionary<string,Type> ();
@@ -1086,5 +1089,30 @@ namespace MonoTests.System.Xaml
                                Assert.AreEqual (XamlLanguage.String, des.Type, "#3");
                        }
                }
+               
+               [Test]
+               [Ignore ("this still does not give successful deserialization result - should there be any way?")]
+               public void Write_StaticExtensionWrapper ()
+               {
+                       //var obj = new StaticExtensionWrapper () { Param = new StaticExtension ("Foo") };
+                       using (var xr = GetReader ("StaticExtensionWrapper.xml")) {
+                               var des = (StaticExtensionWrapper) XamlServices.Load (xr);
+                               Assert.IsNotNull (des.Param, "#1");
+                               Assert.AreEqual ("Foo", des.Param.Member, "#2");
+                       }
+               }
+               
+               [Test]
+               [Ignore ("this still does not give successful deserialization result - should there be any way?")]
+               public void Write_TypeExtensionWrapper ()
+               {
+                       //var obj = new TypeExtensionWrapper () { Param = new TypeExtension ("Foo") };
+                       using (var xr = GetReader ("TypeExtensionWrapper.xml")) {
+                               var des = (TypeExtensionWrapper) XamlServices.Load (xr);
+                               Assert.IsNotNull (des.Param, "#1");
+                               // TypeName was not serialized into xml, hence deserialized as empty.
+                               Assert.AreEqual (String.Empty, des.Param.TypeName, "#2");
+                       }
+               }
        }
 }