public void ReturnFalseAndUnmatchMessage_WhenArgumentIsWithDifferentCaseAndComparisonTypeIsCaseInsensitive() { // Arrange. string value = "Abc"; StringNotEqualValidationPredicate validationPredicate = new StringNotEqualValidationPredicate("abc", StringComparison.OrdinalIgnoreCase); // Act. IValidationPredicateResult result = validationPredicate.Match(value); // Assert. Assert.IsFalse(result.IsMatch); Assert.AreEqual("Argument value <Abc> is equal to <abc>. StringComparison <OrdinalIgnoreCase>.", result.Message); }
public void ReturnFalseAndUnmatchMessage_WhenArgumentIsEqual() { // Arrange. string value = "abc"; StringNotEqualValidationPredicate validationPredicate = new StringNotEqualValidationPredicate("abc", StringComparison.Ordinal); // Act. IValidationPredicateResult result = validationPredicate.Match(value); // Assert. Assert.IsFalse(result.IsMatch); Assert.AreEqual("Argument value <abc> is equal to <abc>. StringComparison <Ordinal>.", result.Message); }
public void ReturnTrueAndMatchMessage_WhenArgumentIsNotEqual() { // Arrange. string value = "xyz"; StringNotEqualValidationPredicate validationPredicate = new StringNotEqualValidationPredicate("abc", StringComparison.OrdinalIgnoreCase); // Act. IValidationPredicateResult result = validationPredicate.Match(value); // Assert. Assert.IsTrue(result.IsMatch); Assert.AreEqual("Argument value <xyz> is not equal to <abc>. StringComparison <OrdinalIgnoreCase>.", result.Message); }