public void SourcePath_ToString(object[] items, string expectedString) { var path = new SourcePath(); foreach (var item in items) { if (item is int i) { path.AddArrayIndex(i); } else if (item is string s) { path.AddFieldName(s); } } var result = path.ArrayString(); Assert.AreEqual(items.Length, path.Count); Assert.AreEqual(expectedString, result); var resultArray = path.ToArray(); Assert.AreEqual(items, resultArray); var origin = path.AsOrigin(); Assert.AreEqual(path, origin.Path); Assert.AreEqual(SourceLocation.None, origin.Location); }