public void Three_failed_attempts_in_a_row_should_fire_BruteForceMessage() { var list = new List<object> { new LoginSucceeded("a"), new LoginFailed("b"), new LoginFailed("b"), new LoginFailed("b") }; var parser = new PossibleAttackPattern(); IEnumerable<PossibleBruteForceAttack> output = parser.Match(list); Assert.AreEqual(1, output.Count()); }
public void Three_failed_attempts_in_a_row_should_fire_BruteForceMessage_with_other_user_interuption() { var list = new List<LoginAttempt> { new LoginFailed("b"), new LoginFailed("b"), new LoginSucceeded("a"), new LoginFailed("b") }; var b = from a in list group a by a.Username; var x = from a in b from p in a select (object)p; var parser = new PossibleAttackPattern(); IEnumerable<PossibleBruteForceAttack> output = parser.Match(new List<object>(x)); Assert.AreEqual(1, output.Count()); }