// 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 ();
}
[Test]
[ExpectedException (typeof (XamlDuplicateMemberException))]
- [Category ("NotWorking")]
public void DuplicateAssignment2 ()
{
var xw = new XamlObjectWriter (sctx, null);
[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);
}
[Test]
- [Category ("NotWorking")]
+ [Category ("NotWorking")] // not worthy of passing
public void StartMemberBeforeNamespace ()
{
var xw = new XamlObjectWriter (sctx, null);
}
[Test]
- [Category ("NotWorking")]
public void GetObjectOnIntValue ()
{
var xw = new XamlObjectWriter (sctx, null);
}
}
+ [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");
}
[Test]
- [Category ("NotWorking")]
public void Write_DictionaryInt32String ()
{
var dic = new Dictionary<int,string> ();
}
[Test]
- [Category ("NotWorking")]
public void Write_DictionaryStringType ()
{
var dic = new Dictionary<string,Type> ();
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");
+ }
+ }
}
}