Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 private void OnValidationEvent(JsonSchemaException exception)
 {
   ValidationEventHandler handler = ValidationEventHandler;
   if (handler != null)
     handler(this, new ValidationEventArgs(exception));
   else
     throw exception;
 }
Ejemplo n.º 3
0
 internal ValidationEventArgs(JsonSchemaException ex)
 {
   ValidationUtils.ArgumentNotNull(ex, "ex");
   _ex = ex;
 }
Ejemplo n.º 4
0
 internal ValidationEventArgs(JsonSchemaException ex)
 {
     ValidationUtils.ArgumentNotNull(ex, "ex");
     _ex = ex;
 }