-Removed obsolete JsonConverter.GetSchema
-Removed obsolete OnDeserialized, OnDeserializing, OnSerialized, OnSerializing, OnError from JsonContract -Removed obsolete JsonDictionaryContract.PropertyNameResolver -Removed obsolete ConstructorParameters, OverrideConstructor, ParametrizedConstructor from JsonObjectContract
This commit is contained in:
@@ -442,15 +442,10 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
|
||||
Assert.IsNull(contract.DefaultCreator);
|
||||
Assert.IsNotNull(contract.ParameterizedCreator);
|
||||
#pragma warning disable 618
|
||||
Assert.AreEqual(contract.ParametrizedConstructor, typeof(PublicParameterizedConstructorWithPropertyNameConflictWithAttribute).GetConstructor(new[] { typeof(string) }));
|
||||
#pragma warning restore 618
|
||||
Assert.AreEqual(1, contract.CreatorParameters.Count);
|
||||
Assert.AreEqual("name", contract.CreatorParameters[0].PropertyName);
|
||||
|
||||
#pragma warning disable 618
|
||||
contract.ParametrizedConstructor = null;
|
||||
#pragma warning restore 618
|
||||
contract.ParameterizedCreator = null;
|
||||
Assert.IsNull(contract.ParameterizedCreator);
|
||||
}
|
||||
|
||||
@@ -462,16 +457,11 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
|
||||
Assert.IsNull(contract.DefaultCreator);
|
||||
Assert.IsNotNull(contract.OverrideCreator);
|
||||
#pragma warning disable 618
|
||||
Assert.AreEqual(contract.OverrideConstructor, typeof(MultipleParametrizedConstructorsJsonConstructor).GetConstructor(new[] { typeof(string), typeof(int) }));
|
||||
#pragma warning restore 618
|
||||
Assert.AreEqual(2, contract.CreatorParameters.Count);
|
||||
Assert.AreEqual("Value", contract.CreatorParameters[0].PropertyName);
|
||||
Assert.AreEqual("Age", contract.CreatorParameters[1].PropertyName);
|
||||
|
||||
#pragma warning disable 618
|
||||
contract.OverrideConstructor = null;
|
||||
#pragma warning restore 618
|
||||
contract.OverrideCreator = null;
|
||||
Assert.IsNull(contract.OverrideCreator);
|
||||
}
|
||||
|
||||
@@ -488,9 +478,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
ensureCustomCreatorCalled = true;
|
||||
return new MultipleParametrizedConstructorsJsonConstructor((string)args[0], (int)args[1]);
|
||||
};
|
||||
#pragma warning disable 618
|
||||
Assert.IsNull(contract.OverrideConstructor);
|
||||
#pragma warning restore 618
|
||||
Assert.IsNotNull(contract.OverrideCreator);
|
||||
|
||||
var o = JsonConvert.DeserializeObject<MultipleParametrizedConstructorsJsonConstructor>("{Value:'value!', Age:1}", new JsonSerializerSettings
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user