-Add support for sharing a static cache for contract resolvers inheriting from DefaultControlResolver
-Correct error message when casting non-JValue to a privative type
This commit is contained in:
@@ -178,5 +178,13 @@ namespace Newtonsoft.Json.Tests.Linq
|
||||
JToken t = new JValue(5L);
|
||||
t[0] = new JValue(3);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException), ExpectedMessage = "Can not convert Null to Int32.")]
|
||||
public void CastNullValueToNonNullable()
|
||||
{
|
||||
JValue v = new JValue((object)null);
|
||||
int i = (int) v;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user