Added Exception.Throws overload to take multiple possible messages to match

This way tests can pass in multiple possible string matches which the runtime may use as a message depending on the given platform (e.g.: MS-Runtime vs Mono)
This commit is contained in:
Redth
2014-09-09 09:39:05 -04:00
parent aa6c474999
commit 831e32809e
5 changed files with 77 additions and 34 deletions
@@ -141,8 +141,12 @@ namespace Newtonsoft.Json.Tests.Serialization
[Test]
public void SerializeDefaultArray()
{
ExceptionAssert.Throws<NullReferenceException>("Object reference not set to an instance of an object.", () =>
JsonConvert.SerializeObject(default(ImmutableArray<int>), Formatting.Indented));
ExceptionAssert.Throws<NullReferenceException>(
() => JsonConvert.SerializeObject(default(ImmutableArray<int>), Formatting.Indented),
new [] {
"Object reference not set to an instance of an object.",
"Object reference not set to an instance of an object" // mono
});
}
#endregion