Update Newtonsoft.Json project to use nullable reference types (#1950)

This commit is contained in:
James Newton-King
2019-07-29 09:13:42 +12:00
committed by GitHub
parent f940f21804
commit cdf10151d5
169 changed files with 2264 additions and 1859 deletions
@@ -242,6 +242,26 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(2, a[2].BeforeSelf().Count());
}
[Test]
public void BeforeSelf_NoParent_ReturnEmpty()
{
JObject o = new JObject();
List<JToken> result = o.BeforeSelf().ToList();
Assert.AreEqual(0, result.Count);
}
[Test]
public void BeforeSelf_OnlyChild_ReturnEmpty()
{
JArray a = new JArray();
JObject o = new JObject();
a.Add(o);
List<JToken> result = o.BeforeSelf().ToList();
Assert.AreEqual(0, result.Count);
}
[Test]
public void Casting()
{