Exemplo n.º 1
0
        public void TestFirstProblem()
        {
            var passports = Day4.ParsePassports("Advent_of_Code_2020.Day4.SampleInput.txt")
                            .ToList();

            Assert.Equal("gry", passports.First().Information["ecl"]);
            Assert.Equal("183cm", passports.First().Information["hgt"]);

            Assert.Equal("#cfa07d", passports.Last().Information["hcl"]);
            Assert.Equal("59in", passports.Last().Information["hgt"]);

            Assert.Empty(Day4.FindMissingPassportFields(passports.First()));
            Assert.Equal(new [] { "hgt" }, Day4.FindMissingPassportFields(passports[1]));

            Assert.Equal(2, Day4.FilterPassportsByExpectedFields(passports).Count());
        }