Ejemplo n.º 1
0
        public void MatchShouldReturnFalseIfMatchingDate()
        {
            //Arrange
            var keys    = new List <string>();
            var matcher = new WhitelistMatcher(keys);

            //Act
            var result = matcher.Match(DateTime.UtcNow);

            //Assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 2
0
        public void MatchShouldReturnFalseIfEmptyWhitelistWithKey()
        {
            //Arrange
            var keys    = new List <string>();
            var matcher = new WhitelistMatcher(keys);

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

            //Assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 3
0
        public void MatchShouldReturnFalseIfMatchingBoolean()
        {
            //Arrange
            var keys    = new List <string>();
            var matcher = new WhitelistMatcher(keys);

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

            //Assert
            Assert.IsFalse(result);
        }
Ejemplo n.º 4
0
        public void MatchShouldReturnTrueOnMatchingKey()
        {
            //Arrange
            var keys = new List <string>();

            keys.Add("test1");
            keys.Add("test2");
            var matcher = new WhitelistMatcher(keys);

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

            //Assert
            Assert.IsTrue(result);
        }
Ejemplo n.º 5
0
        public void MatchShouldReturnFalseOnNonMatchingKeyWithKey()
        {
            //Arrange
            var keys = new List <string>();

            keys.Add("test1");
            keys.Add("test2");
            var matcher = new WhitelistMatcher(keys);

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

            //Assert
            Assert.IsFalse(result);
        }