public void MatchShouldReturnFalseIfEmptyWhitelistString()
        {
            //Arrange
            var toCompare = new List <string>();
            var matcher   = new EndsWithMatcher(toCompare);

            //Act
            var result = matcher.Match("test1");

            //Assert
            Assert.IsFalse(result); //Empty whitelist
        }
        public void MatchShouldReturnTrueOnMatchingKey()
        {
            //Arrange
            var toCompare = new List <string>();

            toCompare.Add("test1");
            toCompare.Add("test2");
            var matcher = new EndsWithMatcher(toCompare);

            //Act
            var result = matcher.Match(new Key("starttest1", "starttest1"));

            //Assert
            Assert.IsTrue(result); //starttest1 ends with test1
        }
        public void MatchShouldReturnFalseOnNonMatchingKeyString()
        {
            //Arrange
            var toCompare = new List <string>();

            toCompare.Add("test1");
            toCompare.Add("test2");
            var matcher = new EndsWithMatcher(toCompare);

            //Act
            var result = matcher.Match("starttest3");

            //Assert
            Assert.IsFalse(result); //key not ends with any element of whitelist
        }
        public void MatchShouldReturnFalseIfMatchingBoolean()
        {
            //Arrange
            var toCompare = new List <string>();

            toCompare.Add("test1");
            toCompare.Add("test2");
            var matcher = new EndsWithMatcher(toCompare);

            //Act
            var result = matcher.Match(true);

            //Assert
            Assert.IsFalse(result);
        }
        public void MatchShouldReturnFalseIfEmptyKeyString()
        {
            //Arrange
            var toCompare = new List <string>();

            toCompare.Add("test1");
            toCompare.Add("test2");
            var matcher = new EndsWithMatcher(toCompare);

            //Act
            string key    = "";
            var    result = matcher.Match(key);

            //Assert
            Assert.IsFalse(result);
        }
        public void MatchShouldReturnFalseIfNullKey()
        {
            //Arrange
            var toCompare = new List <string>();

            toCompare.Add("test1");
            toCompare.Add("test2");
            var matcher = new EndsWithMatcher(toCompare);

            //Act
            string key    = null;
            var    result = matcher.Match(new Key(key, key));

            //Assert
            Assert.IsFalse(result);
        }