-Fixed unhelpful error when failing conversion in JsonReader.ReadAsInt32

This commit is contained in:
James Newton-King
2018-02-17 18:04:00 +13:00
parent ce7f283b94
commit 73203653ba
4 changed files with 93 additions and 42 deletions
@@ -56,6 +56,16 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
#endif
public class ReadAsyncTests : TestFixtureBase
{
[Test]
public async Task ReadAsInt32Async_IntegerTooLarge_ThrowsJsonReaderException()
{
JValue token = new JValue(long.MaxValue);
await ExceptionAssert.ThrowsAsync<JsonReaderException>(
() => token.CreateReader().ReadAsInt32Async()
);
}
[Test]
public async Task ReadMissingInt64()
{