예제 #1
0
        public void ShouldReturnAValidRangeOfIntegerPasswords(List <string> expected, int lowerBound, int upperBound, int characters)
        {
            PasswordBruteForcer bruteForcer = new PasswordBruteForcer(characters, lowerBound, upperBound);
            List <string>       actual      = bruteForcer.GetPossibleIntegerPasswordsInRange().ToList();

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void ShouldCorrectlyCalculateTestCasesForPart2(List <int> input, bool expected)
        {
            bool actual = PasswordBruteForcer.HasPairOfSameCharacters(input) && PasswordBruteForcer.HasNoDecendingValues(input);

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void ShouldReturnTheCorrectResultForPart2()
        {
            PasswordBruteForcer bruteForcer = new PasswordBruteForcer(6, 382345, 843167);

            Assert.Equal(290, bruteForcer.GetValidPasswordsInRange_Part2());
        }
예제 #4
0
 public void ShouldReturnCorrectResultForDecendingPassword(List <int> password, bool expected)
 {
     Assert.Equal(PasswordBruteForcer.HasNoDecendingValues(password), expected);
 }
예제 #5
0
        public void ShouldParseStringIntoIntList(List <int> expected, string input)
        {
            List <int> actual = PasswordBruteForcer.GetIntListFromString(input);

            Assert.Equal(expected, actual);
        }