-Fixed build
This commit is contained in:
@@ -52,6 +52,8 @@ namespace Newtonsoft.Json.Tests
|
||||
{
|
||||
[Test]
|
||||
public void DefaultSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
@@ -68,9 +70,16 @@ namespace Newtonsoft.Json.Tests
|
||||
]
|
||||
}", json);
|
||||
}
|
||||
finally
|
||||
{
|
||||
JsonConvert.DefaultSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultSettings_Override()
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
@@ -84,9 +93,16 @@ namespace Newtonsoft.Json.Tests
|
||||
|
||||
Assert.AreEqual(@"{""test"":[1,2,3]}", json);
|
||||
}
|
||||
finally
|
||||
{
|
||||
JsonConvert.DefaultSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultSettings_Override_JsonConverterOrder()
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
@@ -107,9 +123,16 @@ namespace Newtonsoft.Json.Tests
|
||||
|
||||
Assert.AreEqual(@"[new Date(976593724000)]", json);
|
||||
}
|
||||
finally
|
||||
{
|
||||
JsonConvert.DefaultSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultSettings_Create()
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
@@ -146,9 +169,16 @@ namespace Newtonsoft.Json.Tests
|
||||
|
||||
Assert.AreEqual(@"[1,2,3]", sw.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
JsonConvert.DefaultSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DefaultSettings_CreateWithSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
|
||||
{
|
||||
@@ -190,6 +220,11 @@ namespace Newtonsoft.Json.Tests
|
||||
3
|
||||
]", sw.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
JsonConvert.DefaultSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
public class IntConverter : JsonConverter
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ using NUnit.Framework;
|
||||
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
|
||||
using TestMethod = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
|
||||
using Setup = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitialize;
|
||||
using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute;
|
||||
#endif
|
||||
using Newtonsoft.Json.Utilities;
|
||||
using System.Collections;
|
||||
|
||||
Reference in New Issue
Block a user