-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
@@ -186,9 +186,7 @@ namespace Newtonsoft.Json.Tests.Serialization
var settings =
new JsonSerializerSettings();
ExceptionAssert.Throws<JsonSerializationException>(
"Self referencing loop detected with type 'Newtonsoft.Json.Tests.Serialization.ReferenceLoopHandlingTests+MainClass'. Path 'Child'.",
() => JsonConvert.SerializeObject(main, settings));
ExceptionAssert.Throws<JsonSerializationException>(() => JsonConvert.SerializeObject(main, settings), "Self referencing loop detected with type 'Newtonsoft.Json.Tests.Serialization.ReferenceLoopHandlingTests+MainClass'. Path 'Child'.");
}
[Test]
@@ -247,9 +245,7 @@ namespace Newtonsoft.Json.Tests.Serialization
var settings = new JsonSerializerSettings();
ExceptionAssert.Throws<JsonSerializationException>(
"Self referencing loop detected with type 'Newtonsoft.Json.Tests.Serialization.ReferenceLoopHandlingTests+DictionaryDynamicObject'. Path 'child'.",
() => JsonConvert.SerializeObject(parent, settings));
ExceptionAssert.Throws<JsonSerializationException>(() => JsonConvert.SerializeObject(parent, settings), "Self referencing loop detected with type 'Newtonsoft.Json.Tests.Serialization.ReferenceLoopHandlingTests+DictionaryDynamicObject'. Path 'child'.");
}
[Test]