public void JsonSchemaException() { JsonSchemaException exception = new JsonSchemaException(); Assert.AreEqual("Exception of type 'Newtonsoft.Json.Schema.JsonSchemaException' was thrown.", exception.Message); exception = new JsonSchemaException("Message!"); Assert.AreEqual("Message!", exception.Message); Assert.AreEqual(null, exception.InnerException); exception = new JsonSchemaException("Message!", new Exception("Inner!")); Assert.AreEqual("Message!", exception.Message); Assert.AreEqual("Inner!", exception.InnerException.Message); }
private void OnValidationEvent(JsonSchemaException exception) { ValidationEventHandler handler = ValidationEventHandler; if (handler != null) handler(this, new ValidationEventArgs(exception)); else throw exception; }
internal ValidationEventArgs(JsonSchemaException ex) { ValidationUtils.ArgumentNotNull(ex, "ex"); _ex = ex; }