-Fixed deserializer attempting to populate JSON onto an object that was created with a non-default constructor
-Added GetResolvedPropertyName to DefaultContractResolver
This commit is contained in:
@@ -50,6 +50,22 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.AreEqual("James", p.Name);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PopulateArray()
|
||||
{
|
||||
IList<Person> people = new List<Person>
|
||||
{
|
||||
new Person { Name = "Initial" }
|
||||
};
|
||||
|
||||
JsonConvert.PopulateObject(@"[{""Name"":""James""}, null]", people);
|
||||
|
||||
Assert.AreEqual(3, people.Count);
|
||||
Assert.AreEqual("Initial", people[0].Name);
|
||||
Assert.AreEqual("James", people[1].Name);
|
||||
Assert.AreEqual(null, people[2]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PopulateStore()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user