This commit is contained in:
James Newton-King
2017-05-28 14:51:49 +12:00
2 changed files with 25 additions and 1 deletions
@@ -977,6 +977,23 @@ namespace Newtonsoft.Json.Tests.Converters
return sw.ToString();
}
public class Foo2
{
public XmlElement Bar { get; set; }
}
[Test]
public void SerializeAndDeserializeXmlElement()
{
Foo2 foo = new Foo2 { Bar = null };
string json = JsonConvert.SerializeObject(foo);
Assert.AreEqual(@"{""Bar"":null}", json);
Foo2 foo2 = JsonConvert.DeserializeObject<Foo2>(json);
Assert.IsNull(foo2.Bar);
}
[Test]
public void SingleTextNode()
{