-Refactor ExceptionAssert
This commit is contained in:
@@ -155,17 +155,16 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
[Test]
|
||||
public void NoPublicDefaultConstructor()
|
||||
{
|
||||
ExceptionAssert.Throws<JsonSerializationException>("Unable to find a default constructor to use for type System.Dynamic.DynamicObject. Path 'contributors', line 2, position 18.",
|
||||
() =>
|
||||
{
|
||||
var settings = new JsonSerializerSettings();
|
||||
settings.NullValueHandling = NullValueHandling.Ignore;
|
||||
var json = @"{
|
||||
ExceptionAssert.Throws<JsonSerializationException>(() =>
|
||||
{
|
||||
var settings = new JsonSerializerSettings();
|
||||
settings.NullValueHandling = NullValueHandling.Ignore;
|
||||
var json = @"{
|
||||
""contributors"": null
|
||||
}";
|
||||
|
||||
JsonConvert.DeserializeObject<DynamicObject>(json, settings);
|
||||
});
|
||||
JsonConvert.DeserializeObject<DynamicObject>(json, settings);
|
||||
}, "Unable to find a default constructor to use for type System.Dynamic.DynamicObject. Path 'contributors', line 2, position 18.");
|
||||
}
|
||||
|
||||
public class DictionaryDynamicObject : DynamicObject
|
||||
|
||||
Reference in New Issue
Block a user