Esempio n. 1
0
        public void TestParsingPassWordCheckerNew(string line, int min, int max, string letter, string password, bool valid)
        {
            var sut = new PasswordChecker(line);

            Assert.Equal(line, sut.Line);
            Assert.Equal(min, sut.Min);
            Assert.Equal(max, sut.Max);
            Assert.Equal(letter, sut.Letter);
            Assert.Equal(password, sut.Password);
            bool actual = sut.IsValidNew();

            Assert.Equal(valid, actual);
        }
Esempio n. 2
0
        public void PasswordChecker_Part2()
        {
            var lines = DailyDataUtilities.ReadLinesFromFile("Day02Data.txt");

            Assert.Equal(1000, lines.Length);

            int count = 0;

            foreach (var line in lines)
            {
                var sut = new PasswordChecker(line);
                if (sut.IsValidNew())
                {
                    count++;
                }
            }

            Assert.Equal(634, count);
        }