-Refactor ExceptionAssert

This commit is contained in:
James Newton-King
2014-09-12 21:33:53 +12:00
parent 4b9ce67ab7
commit dfb2ac17a5
43 changed files with 979 additions and 1482 deletions
@@ -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]