-Added AttributeProvider
-Increament version to 7.0.1
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
#if NETFX_CORE
|
||||
@@ -155,6 +156,17 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
Assert.IsNotNull(contract.DefaultCreator);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PropertyAttributeProvider()
|
||||
{
|
||||
var resolver = new DefaultContractResolver();
|
||||
var contract = (JsonObjectContract)resolver.ResolveContract(typeof(Invoice));
|
||||
|
||||
JsonProperty property = contract.Properties["FollowUpDays"];
|
||||
Assert.AreEqual(1, property.AttributeProvider.GetAttributes(false).Count);
|
||||
Assert.AreEqual(typeof(DefaultValueAttribute), property.AttributeProvider.GetAttributes(false)[0].GetType());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AbstractTestClass()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user