Beispiel #1
0
        public static void Run()
        {
            var dayTwo = new DayTwoSolution(PasswordsAndPolicies);

            Console.WriteLine($"Valid passwords: {dayTwo.SumValidPasswords(PasswordStrategy.MinMaxCharacters)}");
            Console.WriteLine($"Valid passwords based on position: {dayTwo.SumValidPasswords(PasswordStrategy.CharacterPosition)}");
        }
        public void SumValidPasswordsBasedOnPosition_ReturnsTheValidPassword(string[] passwordsAndPolicy, int expected)
        {
            //arrange
            var dayTwo = new DayTwoSolution(passwordsAndPolicy.ToList());

            //act
            var result = dayTwo.SumValidPasswords(PasswordStrategy.CharacterPosition);

            //assert
            Assert.Equal(expected, result);
        }