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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user