public static ITestValidationContinuation ShouldHaveAnyValidationError <T>(this TestValidationResult <T> testValidationResult) { if (!testValidationResult.Errors.Any()) { throw new ValidationTestException($"Expected at least one validation error, but none were found."); } return(TestValidationContinuation.Create(testValidationResult.Errors)); }
public static void ShouldNotHaveError <T, TValue>(this TestValidationResult <T, TValue> testValidationResult) where T : class { testValidationResult.Which.ShouldNotHaveValidationError(); }
public static IEnumerable <ValidationFailure> ShouldHaveError <T, TValue>(this TestValidationResult <T, TValue> testValidationResult) where T : class { return(testValidationResult.Which.ShouldHaveValidationError()); }
public static void ShouldNotHaveAnyValidationErrors <T, TValue>(this TestValidationResult <T, TValue> testValidationResult) where T : class { // TODO: Remove the second generic for 9.0. ShouldNotHaveValidationError(testValidationResult.Errors, MatchAnyFailure); }
public static IEnumerable <ValidationFailure> ShouldHaveAnyValidationError <T, TValue>(this TestValidationResult <T, TValue> testValidationResult) where T : class { // TODO: Remove the second generic for 9.0. if (!testValidationResult.Errors.Any()) { throw new ValidationTestException($"Expected at least one validation error, but none were found."); } return(testValidationResult.Errors); }
public static void ShouldNotHaveAnyValidationErrors <T>(this TestValidationResult <T> testValidationResult) where T : class { ShouldNotHaveValidationError(testValidationResult.Errors, MatchAnyFailure, true); }
public static IEnumerable <ValidationFailure> ShouldHaveAnyValidationError <T>(this TestValidationResult <T> testValidationResult) where T : class { if (!testValidationResult.Errors.Any()) { throw new ValidationTestException($"Expected at least one validation error, but none were found."); } return(testValidationResult.Errors); }
public ValidationResultTester(TestValidationResult <T, TValue> testValidationResult) { this.testValidationResult = testValidationResult; }