-Removed obsolete constructor from DefaultContractResolver

-Removed obsolete async methods from JsonConvert
-Moved contract sharing logic from DefaultContractResolver to CamelCasePropertyNamesContractResolver
This commit is contained in:
James Newton-King
2017-01-28 20:25:01 +13:00
parent bfddda84f4
commit 1914b91bdb
13 changed files with 106 additions and 341 deletions
@@ -44,6 +44,18 @@ namespace Newtonsoft.Json.Tests.Serialization
[TestFixture]
public class CamelCasePropertyNamesContractResolverTests : TestFixtureBase
{
[Test]
public void EnsureContractsShared()
{
CamelCasePropertyNamesContractResolver resolver1 = new CamelCasePropertyNamesContractResolver();
var contract1 = resolver1.ResolveContract(typeof(CamelCasePropertyNamesContractResolverTests));
CamelCasePropertyNamesContractResolver resolver2 = new CamelCasePropertyNamesContractResolver();
var contract2 = resolver1.ResolveContract(typeof(CamelCasePropertyNamesContractResolverTests));
Assert.IsTrue(ReferenceEquals(contract1, contract2));
}
[Test]
public void JsonConvertSerializerSettings()
{
@@ -55,9 +55,6 @@ namespace Newtonsoft.Json.Tests.Serialization
private readonly char _startingWithChar;
public DynamicContractResolver(char startingWithChar)
#pragma warning disable 612,618
: base(false)
#pragma warning restore 612,618
{
_startingWithChar = startingWithChar;
}