public void SourceOrigin_NoPath_PropertyCheck()
        {
            var location = new SourceLocation(5, 2, 1);

            var origin = new SourceOrigin(location);

            Assert.AreEqual(SourcePath.None, origin.Path);
            Assert.AreEqual(location, origin.Location);

            // use location string if path is empty
            Assert.AreEqual(location.ToString(), origin.ToString());
        }
        public void SourceOrigin_WithBothParts_PropertyCheck()
        {
            var path = new SourcePath();

            path.AddFieldName("topField");
            path.AddFieldName("middleField");
            path.AddArrayIndex(0);

            var location = new SourceLocation(5, 2, 1);

            var origin = new SourceOrigin(location, path);

            Assert.AreEqual(path, origin.Path);
            Assert.AreEqual(location, origin.Location);

            // prefer path over source text when available
            Assert.AreEqual(path.ToString(), origin.ToString());
        }