-Changed serialization callbacks on JsonContract to delegates

-Added Obsolete attributes to old serialization methods on JsonContract
-Added VS and ReSharper settings files
-Fixed converting null JSON value to XML
-Fixed tests
This commit is contained in:
James Newton-King
2013-03-17 14:25:01 +13:00
parent 1356c31670
commit e857e48564
13 changed files with 182 additions and 112 deletions
@@ -1902,6 +1902,27 @@ namespace Newtonsoft.Json.Tests.Converters
Assert.AreEqual(@"{""root"":{""@xmlns"":""http://www.example.com/ns"",""a"":null,""bns:b"":{""@xmlns:bns"":""http://www.example.com/ns""},""c"":null}}", json2);
#endif
}
#if !NET20
class NullableXml
{
public string Name;
public XElement notNull;
public XElement isNull;
}
[Test]
public void SerializeAndDeserializeNullableXml()
{
var xml = new NullableXml { Name = "test", notNull = XElement.Parse("<root>test</root>") };
var json = JsonConvert.SerializeObject(xml);
var w2 = JsonConvert.DeserializeObject<NullableXml>(json);
Assert.AreEqual(xml.Name, w2.Name);
Assert.AreEqual(xml.isNull, w2.isNull);
Assert.AreEqual(xml.notNull.ToString(), w2.notNull.ToString());
}
#endif
}
}
#endif