-Fixed build

This commit is contained in:
James Newton-King
2014-02-23 14:58:13 +13:00
parent e4ae07003b
commit 36deaa4b10
@@ -1911,8 +1911,9 @@ namespace Newtonsoft.Json.Tests.Converters
}
#endif
#if !NET20
[Test]
public void SerializeAndDeserializeXmlWithNamespaceInChildrenRootDontHaveNameSpace()
public void SerializeAndDeserializeXElementWithNamespaceInChildrenRootDontHaveNameSpace()
{
var xmlString = @"<root>
<b xmlns='http://www.example.com/ns'>Asd</b>
@@ -1928,6 +1929,25 @@ namespace Newtonsoft.Json.Tests.Converters
var equals = XElement.DeepEquals(xmlBack, xml);
Assert.IsTrue(equals);
}
#endif
[Test]
public void SerializeAndDeserializeXmlElementWithNamespaceInChildrenRootDontHaveNameSpace()
{
var xmlString = @"<root>
<b xmlns='http://www.example.com/ns'>Asd</b>
<c>AAA</c>
<test>adad</test>
</root>";
XmlDocument xml = new XmlDocument();
xml.LoadXml(xmlString);
var json1 = JsonConvert.SerializeXmlNode(xml);
var xmlBack = JsonConvert.DeserializeObject<XmlDocument>(json1);
Assert.AreEqual(@"<root><b xmlns=""http://www.example.com/ns"">Asd</b><c>AAA</c><test>adad</test></root>", xmlBack.OuterXml);
}
}
}
#endif