public void ValidateObject_IValidatableObject_Success() { var instance = new ValidatableSuccess(); var context = new ValidationContext(instance); Validator.ValidateObject(instance, context); }
public void TryValidateObject_IValidatableObject_Success() { var instance = new ValidatableSuccess(); var context = new ValidationContext(instance); var results = new List <ValidationResult>(); Assert.True(Validator.TryValidateObject(instance, context, results)); Assert.Empty(results); }