public void ExactMatcher_IsMatch_SinglePattern()
        {
            // Assign
            var matcher = new ExactMatcher("cat");

            // Act
            double result = matcher.IsMatch("caR");

            // Assert
            Check.That(result).IsEqualTo(0.0);
        }
        public void ExactMatcher_IsMatch_SinglePattern_RejectOnMatch()
        {
            // Assign
            var matcher = new ExactMatcher(MatchBehaviour.RejectOnMatch, "cat");

            // Act
            double result = matcher.IsMatch("cat");

            // Assert
            Check.That(result).IsEqualTo(0.0);
        }
        public void ExactMatcher_IsMatch_MultiplePatterns()
        {
            // Assign
            var matcher = new ExactMatcher("x", "y");

            // Act
            double result = matcher.IsMatch("x");

            // Assert
            Check.That(result).IsEqualTo(0.5d);
        }
예제 #4
0
        public void ExactMatcher_IsMatch_WithMultiplePatterns_ReturnsMatch0_5()
        {
            // Assign
            var matcher = new ExactMatcher("x", "y");

            // Act
            double result = matcher.IsMatch("x");

            // Assert
            Check.That(result).IsEqualTo(1.0);
        }
예제 #5
0
        public void ExactMatcher_IsMatch_WithSinglePattern_ReturnsMatch0_0()
        {
            // Assign
            var matcher = new ExactMatcher("x");

            // Act
            double result = matcher.IsMatch("y");

            // Assert
            Check.That(result).IsEqualTo(0.0);
        }
예제 #6
0
        public void Request_WithBodyExactMatcher_false()
        {
            // Assign
            var matcher = new ExactMatcher("cat");

            // Act
            double result = matcher.IsMatch("caR");

            // Assert
            Check.That(result).IsStrictlyLessThan(1.0);
        }
예제 #7
0
        public void IsMatch_NonMatchingCondition_ReturnsFalse()
        {
            //arrange
            string   pattern      = "abc";
            IMatcher exactMatcher = new ExactMatcher(pattern);

            //act
            MatchResult matchResult = exactMatcher.IsMatch("now I know my abcs");
            bool        isMatch     = matchResult.IsMatch;

            //assert
            Assert.NotNull(exactMatcher);
            Assert.NotNull(matchResult);
            Assert.False(isMatch);
        }