Run unit tests on .NET Core 3.0 and fix Enumerable.Empty (#2137)
This commit is contained in:
@@ -200,10 +200,22 @@ namespace Newtonsoft.Json.Tests.JsonTextReaderTests
|
||||
Assert.AreEqual(Double.MinValue, reader.Value);
|
||||
|
||||
reader = new JsonTextReader(new StringReader("1E+309"));
|
||||
#if !NETSTANDARD2_0
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => await reader.ReadAsync(), "Input string '1E+309' is not a valid number. Path '', line 1, position 6.");
|
||||
#else
|
||||
Assert.IsTrue(await reader.ReadAsync());
|
||||
Assert.AreEqual(typeof(double), reader.ValueType);
|
||||
Assert.AreEqual(Double.PositiveInfinity, reader.Value);
|
||||
#endif
|
||||
|
||||
reader = new JsonTextReader(new StringReader("-1E+5000"));
|
||||
#if !NETSTANDARD2_0
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => await reader.ReadAsync(), "Input string '-1E+5000' is not a valid number. Path '', line 1, position 8.");
|
||||
#else
|
||||
Assert.IsTrue(await reader.ReadAsync());
|
||||
Assert.AreEqual(typeof(double), reader.ValueType);
|
||||
Assert.AreEqual(Double.NegativeInfinity, reader.Value);
|
||||
#endif
|
||||
|
||||
reader = new JsonTextReader(new StringReader("5.1231231E"));
|
||||
await ExceptionAssert.ThrowsAsync<JsonReaderException>(async () => await reader.ReadAsync(), "Input string '5.1231231E' is not a valid number. Path '', line 1, position 10.");
|
||||
|
||||
Reference in New Issue
Block a user