public GetBusinessRuleValidationCount ( ) : int | ||
return | int |
public void AcceptsNullArguments() { var validationContext = new ValidationContext(null, null); Assert.AreEqual(0, validationContext.GetFieldValidationCount()); Assert.AreEqual(0, validationContext.GetBusinessRuleValidationCount()); }
public void ReturnsRightAmountForEmptyValidationContextWithTag() { var context = new ValidationContext(); Assert.AreEqual(0, context.GetBusinessRuleValidationCount("tag")); }
public void CorrectlyHandlesRemovalOfNonExistingValidationResult() { var validationContext = new ValidationContext(); var businessRuleValidation = BusinessRuleValidationResult.CreateError("MyError"); Assert.AreEqual(0, validationContext.GetBusinessRuleValidationCount()); validationContext.RemoveBusinessRuleValidationResult(businessRuleValidation); Assert.AreEqual(0, validationContext.GetBusinessRuleValidationCount()); }
public void AddsValidationResultTwice() { var validationContext = new ValidationContext(); var businessRuleValidation = BusinessRuleValidationResult.CreateError("MyProperty"); validationContext.AddBusinessRuleValidationResult(businessRuleValidation); Assert.AreEqual(1, validationContext.GetBusinessRuleValidationCount()); validationContext.AddBusinessRuleValidationResult(businessRuleValidation); Assert.AreEqual(2, validationContext.GetBusinessRuleValidationCount()); }