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
+28 -12
View File
@@ -127,8 +127,10 @@ namespace Newtonsoft.Json.Tests.Linq
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentNullException>(() => { ((ICollection<JToken>)j).CopyTo(null, 0); }, @"Value cannot be null.
Parameter name: array");
ExceptionAssert.Throws<ArgumentNullException>(() => { ((ICollection<JToken>)j).CopyTo(null, 0); },
@"Value cannot be null.
Parameter name: array",
"Value cannot be null. (Parameter 'array')");
}
[Test]
@@ -136,8 +138,10 @@ Parameter name: array");
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { ((ICollection<JToken>)j).CopyTo(new JToken[1], -1); }, @"arrayIndex is less than 0.
Parameter name: arrayIndex");
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { ((ICollection<JToken>)j).CopyTo(new JToken[1], -1); },
@"arrayIndex is less than 0.
Parameter name: arrayIndex",
"arrayIndex is less than 0. (Parameter 'arrayIndex')");
}
[Test]
@@ -232,8 +236,11 @@ Parameter name: arrayIndex");
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.RemoveAt(0); }, @"Index is equal to or greater than Count.
Parameter name: index");
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
() => { j.RemoveAt(0); },
@"Index is equal to or greater than Count.
Parameter name: index",
"Index is equal to or greater than Count. (Parameter 'index')");
}
[Test]
@@ -241,8 +248,11 @@ Parameter name: index");
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.RemoveAt(-1); }, @"Index is less than 0.
Parameter name: index");
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
() => { j.RemoveAt(-1); },
@"Index is less than 0.
Parameter name: index",
"Index is less than 0. (Parameter 'index')");
}
[Test]
@@ -320,8 +330,11 @@ Parameter name: index");
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.Insert(-1, new JValue(1)); }, @"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index");
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
() => { j.Insert(-1, new JValue(1)); },
@"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index",
"Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')");
}
[Test]
@@ -329,8 +342,11 @@ Parameter name: index");
{
JArray j = new JArray();
ExceptionAssert.Throws<ArgumentOutOfRangeException>(() => { j.Insert(2, new JValue(1)); }, @"Index must be within the bounds of the List.
Parameter name: index");
ExceptionAssert.Throws<ArgumentOutOfRangeException>(
() => { j.Insert(2, new JValue(1)); },
@"Index must be within the bounds of the List.
Parameter name: index",
"Index must be within the bounds of the List. (Parameter 'index')");
}
[Test]