-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:
James Newton-King
2012-05-27 21:29:02 +12:00
parent 2fbf5f7808
commit aef0759038
9 changed files with 132 additions and 26 deletions
@@ -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()
{