-Refactor ExceptionAssert
This commit is contained in:
@@ -63,9 +63,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
// ]
|
||||
//}
|
||||
|
||||
ExceptionAssert.Throws<JsonSerializationException>(
|
||||
@"Could not find member 'Price' on object of type 'ProductShort'. Path 'Price', line 4, position 11.",
|
||||
() => { ProductShort deserializedProductShort = (ProductShort)JsonConvert.DeserializeObject(output, typeof(ProductShort), new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error }); });
|
||||
ExceptionAssert.Throws<JsonSerializationException>(() => { ProductShort deserializedProductShort = (ProductShort)JsonConvert.DeserializeObject(output, typeof(ProductShort), new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error }); }, @"Could not find member 'Price' on object of type 'ProductShort'. Path 'Price', line 4, position 11.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -128,9 +126,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
{
|
||||
string json = @"{""Missing"":1}";
|
||||
|
||||
ExceptionAssert.Throws<JsonSerializationException>(
|
||||
"Could not find member 'Missing' on object of type 'DoubleClass'. Path 'Missing', line 1, position 11.",
|
||||
() => { JsonConvert.DeserializeObject<DoubleClass>(json, new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error }); });
|
||||
ExceptionAssert.Throws<JsonSerializationException>(() => { JsonConvert.DeserializeObject<DoubleClass>(json, new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error }); }, "Could not find member 'Missing' on object of type 'DoubleClass'. Path 'Missing', line 1, position 11.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user