-Added Path to JsonReaderException, JsonSchemaException and ValidationEventArgs

-Fixed Path on JsonValidatingReader
-Fixed path queries over constructors
This commit is contained in:
James Newton-King
2012-02-25 16:44:07 +13:00
parent 0d6ad0b76e
commit fb2a5998bc
14 changed files with 142 additions and 47 deletions
@@ -113,9 +113,10 @@ namespace Newtonsoft.Json.Tests.Schema
JObject o = JObject.Parse("{'lol':1}");
List<string> errors = new List<string>();
o.Validate(schema, (sender, args) => errors.Add(args.Message));
o.Validate(schema, (sender, args) => errors.Add(args.Path + " - " + args.Message));
Assert.AreEqual("Invalid type. Expected String but got Integer. Line 1, position 8.", errors[0]);
Assert.AreEqual("lol - Invalid type. Expected String but got Integer. Line 1, position 8.", errors[0]);
Assert.AreEqual("1", o.SelectToken("lol").ToString());
Assert.AreEqual(1, errors.Count);
}