Merge branch 'master' of github.com:JamesNK/Newtonsoft.Json
This commit is contained in:
@@ -2975,8 +2975,11 @@ Path '', line 1, position 1.",
|
||||
string json = @"[]";
|
||||
|
||||
ExceptionAssert.Throws<InvalidCastException>(
|
||||
@"Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.",
|
||||
() => { JsonConvert.DeserializeObject<JObject>(json); });
|
||||
() => { JsonConvert.DeserializeObject<JObject>(json); },
|
||||
new [] {
|
||||
"Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.",
|
||||
"Cannot cast from source type to destination type." // mono
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -6304,18 +6307,22 @@ To fix this error either change the environment to be fully trusted, change the
|
||||
public void DeserializeDoubleFromNullString()
|
||||
{
|
||||
ExceptionAssert.Throws<ArgumentNullException>(
|
||||
@"Value cannot be null.
|
||||
Parameter name: value",
|
||||
() => { JsonConvert.DeserializeObject<double>(null); });
|
||||
() => { JsonConvert.DeserializeObject<double>(null); },
|
||||
new [] {
|
||||
"Value cannot be null." + Environment.NewLine + "Parameter name: value",
|
||||
"Argument cannot be null." + Environment.NewLine + "Parameter name: value" // mono
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DeserializeFromNullString()
|
||||
{
|
||||
ExceptionAssert.Throws<ArgumentNullException>(
|
||||
@"Value cannot be null.
|
||||
Parameter name: value",
|
||||
() => { JsonConvert.DeserializeObject(null); });
|
||||
() => { JsonConvert.DeserializeObject(null); },
|
||||
new [] {
|
||||
"Value cannot be null." + Environment.NewLine + "Parameter name: value",
|
||||
"Argument cannot be null." + Environment.NewLine + "Parameter name: value" // mono
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user