-Added Merge to LINQ to JSON

This commit is contained in:
James Newton-King
2014-08-01 21:27:38 +12:00
parent 490895716c
commit 5fc738247f
22 changed files with 796 additions and 4 deletions
@@ -120,6 +120,25 @@ namespace Newtonsoft.Json.Tests.Converters
return node;
}
#if !NET20
public class Foo
{
public XElement Bar { get; set; }
}
[Test]
public void SerializeAndDeserializeXElement()
{
Foo foo = new Foo { Bar = null };
string json = JsonConvert.SerializeObject(foo);
Assert.AreEqual(@"{""Bar"":null}", json);
Foo foo2 = JsonConvert.DeserializeObject<Foo>(json);
Assert.IsNull(foo2.Bar);
}
#endif
[Test]
public void SerializeXmlElement()
{