-Built-in converters inherit from JsonConverter

-Fixed writing null values by XmlNodeConverter and RegexConverter
-Tests
-Documentation
This commit is contained in:
James Newton-King
2017-08-12 20:17:28 +12:00
parent 0996a59f8c
commit 946b43fab8
15 changed files with 268 additions and 36 deletions
@@ -36,6 +36,7 @@ using NUnit.Framework;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Tests.TestObjects;
using System.Data;
using System.IO;
namespace Newtonsoft.Json.Tests.Converters
{
@@ -107,6 +108,18 @@ namespace Newtonsoft.Json.Tests.Converters
public DataSet Set { get; set; }
}
[Test]
public void WriteJsonNull()
{
StringWriter sw = new StringWriter();
JsonTextWriter jsonWriter = new JsonTextWriter(sw);
DataSetConverter converter = new DataSetConverter();
converter.WriteJson(jsonWriter, null, null);
StringAssert.AreEqual(@"null", sw.ToString());
}
[Test]
public void SerializeNull()
{