Run unit tests on .NET Core 3.0 and fix Enumerable.Empty (#2137)

This commit is contained in:
James Newton-King
2019-08-19 12:57:09 +12:00
committed by GitHub
parent 083aa6df83
commit 5eac02a797
22 changed files with 300 additions and 81 deletions
@@ -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.");