コード例 #1
0
        public void MatchShouldReturnFalseIfMatchingBoolean()
        {
            //Arrange
            var toCompare = new List <string>();

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

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

            //Assert
            Assert.IsFalse(result);
        }
コード例 #2
0
        public void MatchShouldReturnFalseIfNullKey()
        {
            //Arrange
            var toCompare = new List <string>();

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

            //Act
            List <string> key    = null;
            var           result = matcher.Match(key);

            //Assert
            Assert.IsFalse(result);
        }
コード例 #3
0
        public void MatchShouldReturnFalseIfEmptyWhitelist()
        {
            //Arrange
            var toCompare = new List <string>();
            var matcher   = new ContainsAllOfSetMatcher(toCompare);

            //Act
            var keys = new List <string>();

            keys.Add("test1");
            keys.Add("test3");

            var result = matcher.Match(keys);

            //Assert
            Assert.IsFalse(result); //Empty whitelist
        }
コード例 #4
0
        public void MatchShouldReturnFalseOnNonMatchingKey()
        {
            //Arrange
            var toCompare = new List <string>();

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

            //Act
            var keys = new List <string>();

            keys.Add("test4");
            keys.Add("test3");

            var result = matcher.Match(keys);

            //Assert
            Assert.IsFalse(result); //keys contains no elements from set
        }
コード例 #5
0
        public void MatchShouldReturnTrueOnMatchingKey()
        {
            //Arrange
            var toCompare = new List <string>();

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

            //Act
            var keys = new List <string>();

            keys.Add("test1");
            keys.Add("test2");
            keys.Add("test3");

            var result = matcher.Match(keys);

            //Assert
            Assert.IsTrue(result); //keys contains test1 and test2
        }