-Fixed PR test
This commit is contained in:
@@ -234,7 +234,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.IsNotNull(o);
|
||||
Assert.IsNotNull(o.Logger);
|
||||
Assert.IsNotNull(o.Repository);
|
||||
Assert.IsNotNull(o.Repository.CreatedOn);
|
||||
Assert.AreEqual(o.Repository.CreatedOn, DateTime.Parse("2015-04-01 20:00"));
|
||||
|
||||
Assert.AreEqual(2, count);
|
||||
|
||||
|
||||
@@ -883,17 +883,15 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
ValidationUtils.ArgumentNotNull(targetType, "targetType");
|
||||
|
||||
List<PropertyInfo> propertyInfos;
|
||||
List<PropertyInfo> propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
|
||||
|
||||
if (!targetType.IsInterface())
|
||||
// GetProperties on an interface doesn't return properties from its interfaces
|
||||
if (targetType.IsInterface())
|
||||
{
|
||||
propertyInfos = new List<PropertyInfo>(targetType.GetProperties(bindingAttr));
|
||||
}
|
||||
else
|
||||
{
|
||||
propertyInfos = (new Type[] { targetType })
|
||||
.Concat(targetType.GetInterfaces())
|
||||
.SelectMany(i => i.GetProperties(bindingAttr)).ToList();
|
||||
foreach (Type i in targetType.GetInterfaces())
|
||||
{
|
||||
propertyInfos.AddRange(i.GetProperties(bindingAttr));
|
||||
}
|
||||
}
|
||||
|
||||
GetChildPrivateProperties(propertyInfos, targetType, bindingAttr);
|
||||
|
||||
Reference in New Issue
Block a user