public void Validate_WithoutRuleName_Valid(string name, int age) { var customer = new Customer { Name = name, Age = age }; var validationResult = _modelValidator.Validate(customer); Assert.AreEqual(true, validationResult.IsValid); }
public void Validate_WithoutRuleName_IsNotValid(string name, int age) { var customer = new Customer { Name = name, Age = age }; var validationResult = _modelValidator.Validate(customer); Assert.AreEqual(false, validationResult.IsValid); Assert.AreEqual(2, validationResult.Errors.Count); }