public void MatchShouldReturnFalseIfEmptyWhitelist() { //Arrange var toCompare = new List <string>(); var matcher = new StartsWithMatcher(toCompare); //Act var result = matcher.Match(new Key("test1", "test1")); //Assert Assert.IsFalse(result); //Empty whitelist }
public void MatchShouldReturnFalseIfMatchingLong() { //Arrange var toCompare = new List <string>(); toCompare.Add("test1"); toCompare.Add("test2"); var matcher = new StartsWithMatcher(toCompare); //Act var result = matcher.Match(123); //Assert Assert.IsFalse(result); }
public void MatchShouldReturnFalseOnNonMatchingKey() { //Arrange var toCompare = new List <string>(); toCompare.Add("test1"); toCompare.Add("test2"); var matcher = new StartsWithMatcher(toCompare); //Act var result = matcher.Match(new Key("test3end", "test3end")); //Assert Assert.IsFalse(result); //key not starts with any element of whitelist }
public void MatchShouldReturnTrueOnMatchingKeyString() { //Arrange var toCompare = new List <string>(); toCompare.Add("test1"); toCompare.Add("test2"); var matcher = new StartsWithMatcher(toCompare); //Act var result = matcher.Match("test1end"); //Assert Assert.IsTrue(result); //test1end starts with test1 }
public void MatchShouldReturnFalseIfEmptyKey() { //Arrange var toCompare = new List <string>(); toCompare.Add("test1"); toCompare.Add("test2"); var matcher = new StartsWithMatcher(toCompare); //Act string key = ""; var result = matcher.Match(new Key(key, key)); //Assert Assert.IsFalse(result); }
public void MatchShouldReturnFalseIfNullKeyString() { //Arrange var toCompare = new List <string>(); toCompare.Add("test1"); toCompare.Add("test2"); var matcher = new StartsWithMatcher(toCompare); //Act string key = null; var result = matcher.Match(key); //Assert Assert.IsFalse(result); }