コード例 #1
0
        public void HasXValidPasswordsInFile()
        {
            var path = Path.Combine("RentalShop", "TestData", "input.txt");
            var rentalShopPasswordSet = new RentalShopPasswordSet(path);
            var result = rentalShopPasswordSet.GetValidPasswordCount();

            Console.WriteLine(result);
            Assert.That(result, Is.EqualTo(294));
        }
コード例 #2
0
        public void Has2ValidPasswords()
        {
            var policiesAndPasswords = new List <string>()
            {
                "1-3 a: abcde",
                "1-3 b: cdefg",
                "2-9 c: ccccccccc"
            };
            var rentalShopPasswordSet = new RentalShopPasswordSet(policiesAndPasswords);
            var result = rentalShopPasswordSet.GetValidPasswordCount();

            Assert.That(result, Is.EqualTo(1));
        }