diff --git a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs index 4a54f5cb..a8e45072 100644 --- a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs +++ b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs @@ -1694,12 +1694,12 @@ Parameter name: arrayIndex", [Test] public void GetProperties() { - JObject o = JObject.Parse("{'prop1':12,'prop2':'hi!'}"); + JObject o = JObject.Parse("{'prop1':12,'prop2':'hi!','prop3':null,'prop4':[1,2,3]}"); ICustomTypeDescriptor descriptor = o; PropertyDescriptorCollection properties = descriptor.GetProperties(); - Assert.AreEqual(2, properties.Count); + Assert.AreEqual(4, properties.Count); PropertyDescriptor prop1 = properties[0]; Assert.AreEqual("prop1", prop1.Name); @@ -1714,6 +1714,20 @@ Parameter name: arrayIndex", Assert.AreEqual(typeof(JObject), prop2.ComponentType); Assert.AreEqual(false, prop2.CanResetValue(o)); Assert.AreEqual(false, prop2.ShouldSerializeValue(o)); + + PropertyDescriptor prop3 = properties[2]; + Assert.AreEqual("prop3", prop3.Name); + Assert.AreEqual(typeof(object), prop3.PropertyType); + Assert.AreEqual(typeof(JObject), prop3.ComponentType); + Assert.AreEqual(false, prop3.CanResetValue(o)); + Assert.AreEqual(false, prop3.ShouldSerializeValue(o)); + + PropertyDescriptor prop4 = properties[3]; + Assert.AreEqual("prop4", prop4.Name); + Assert.AreEqual(typeof(object), prop4.PropertyType); + Assert.AreEqual(typeof(JObject), prop4.ComponentType); + Assert.AreEqual(false, prop4.CanResetValue(o)); + Assert.AreEqual(false, prop4.ShouldSerializeValue(o)); } #endif