-Changed DataContractAttribute on collections back to array serialization

-Fixed JObject.GetPropertyOwner to return value
-Fixed JPropertyDescriptor GetValue and SetValue to return null for null owner
This commit is contained in:
James Newton-King
2018-03-12 15:43:28 +13:00
parent 4f1aa395db
commit c72f785b9c
6 changed files with 57 additions and 21 deletions
@@ -50,6 +50,14 @@ namespace Newtonsoft.Json.Tests.Linq.ComponentModel
Assert.AreEqual(o["prop2"], prop2.GetValue(o));
}
[Test]
public void GetValue_NullOwner_ReturnsNull()
{
JPropertyDescriptor prop1 = new JPropertyDescriptor("prop1");
Assert.AreEqual(null, prop1.GetValue(null));
}
[Test]
public void SetValue()
{
@@ -62,6 +70,14 @@ namespace Newtonsoft.Json.Tests.Linq.ComponentModel
Assert.AreEqual("54321!", (string)o["prop1"]);
}
[Test]
public void SetValue_NullOwner_NoError()
{
JPropertyDescriptor prop1 = new JPropertyDescriptor("prop1");
prop1.SetValue(null, "value!");
}
[Test]
public void ResetValue()
{