示例#1
0
        public void ReturnFalseAndUnmatchMessage_WhenBoundIsNotNullAndArgumentIsNull()
        {
            // Arrange.
            string value = null;
            GreaterThanOrEqualValidationPredicate <string> validationPredicate = new GreaterThanOrEqualValidationPredicate <string>("a");

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsFalse(result.IsMatch);
            Assert.AreEqual("Argument value <null> is less than <a>.", result.Message);
        }
示例#2
0
        public void ReturnTrueAndMatchMessage_WhenArgumentIsGreaterThanTheBound()
        {
            // Arrange.
            int value = 4;
            GreaterThanOrEqualValidationPredicate <int> validationPredicate = new GreaterThanOrEqualValidationPredicate <int>(3);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsTrue(result.IsMatch);
            Assert.AreEqual("Argument value <4> is greater than or equal to <3>.", result.Message);
        }
示例#3
0
        public void ReturnTrueAndMatchMessage_WhenBoundIsNullAndArgumentIsNull()
        {
            // Arrange.
            string value = null;
            GreaterThanOrEqualValidationPredicate <string> validationPredicate = new GreaterThanOrEqualValidationPredicate <string>(null);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsTrue(result.IsMatch);
            Assert.AreEqual("Argument value <null> is greater than or equal to <null>.", result.Message);
        }
示例#4
0
        public void ReturnFalseAndUnmatchMessage_WhenArgumentIsLessThanTheBound()
        {
            // Arrange.
            int value = 2;
            GreaterThanOrEqualValidationPredicate <int> validationPredicate = new GreaterThanOrEqualValidationPredicate <int>(3);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsFalse(result.IsMatch);
            Assert.AreEqual("Argument value <2> is less than <3>.", result.Message);
        }
        public void ReturnTrueAndMatchMessage_WhenBoundIsNullAndArgumentIsNull()
        {
            // Arrange.
            string value = null;
            GreaterThanOrEqualValidationPredicate<string> validationPredicate = new GreaterThanOrEqualValidationPredicate<string>(null);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsTrue(result.IsMatch);
            Assert.AreEqual("Argument value <null> is greater than or equal to <null>.", result.Message);
        }
        public void ReturnTrueAndMatchMessage_WhenArgumentIsGreaterThanTheBound()
        {
            // Arrange.
            int value = 4;
            GreaterThanOrEqualValidationPredicate<int> validationPredicate = new GreaterThanOrEqualValidationPredicate<int>(3);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsTrue(result.IsMatch);
            Assert.AreEqual("Argument value <4> is greater than or equal to <3>.", result.Message);
        }
        public void ReturnFalseAndUnmatchMessage_WhenArgumentIsLessThanTheBound()
        {
            // Arrange.
            int value = 2;
            GreaterThanOrEqualValidationPredicate<int> validationPredicate = new GreaterThanOrEqualValidationPredicate<int>(3);

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsFalse(result.IsMatch);
            Assert.AreEqual("Argument value <2> is less than <3>.", result.Message);
        }
        public void ReturnFalseAndUnmatchMessage_WhenBoundIsNotNullAndArgumentIsNull()
        {
            // Arrange.
            string value = null;
            GreaterThanOrEqualValidationPredicate<string> validationPredicate = new GreaterThanOrEqualValidationPredicate<string>("a");

            // Act.
            IValidationPredicateResult result = validationPredicate.Match(value);

            // Assert.
            Assert.IsFalse(result.IsMatch);
            Assert.AreEqual("Argument value <null> is less than <a>.", result.Message);
        }