예제 #1
0
        public void JsonSchemaException()
        {
            JsonSchemaException exception = new JsonSchemaException();
            Assert.Equal("Exception of type 'OpenGamingLibrary.Json.Schema.JsonSchemaException' was thrown.", exception.Message);

            exception = new JsonSchemaException("Message!");
            Assert.Equal("Message!", exception.Message);
            Assert.Equal(null, exception.InnerException);

            exception = new JsonSchemaException("Message!", new Exception("Inner!"));
            Assert.Equal("Message!", exception.Message);
            Assert.Equal("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;
 }