public void ValidatePassport_ShouldReturnFalse_WhenGivenPassportWithMissingRequiredData() { var sut = new PassportProcessing(); var actual = sut.ValidatePassport(sut.ParseInputData("pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980")[0]); actual.Should().BeFalse(); }
public void ValidatePassport_ShouldReturnTrue_WhenGivenValidPassport() { var sut = new PassportProcessing(); var actual = sut.ValidatePassport(sut.ParseInputData("pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980 hcl:#623a2f")[0]); actual.Should().BeTrue(); }
public void ValidatePassport_ShouldReturnFalse_WhenGivenDataValuesOutOfRange(string input) { var sut = new PassportProcessing(); var passportData = sut.ParseInputData(input)[0]; var actual = sut.ValidatePassport(passportData); actual.Should().BeFalse(); }
public void ValidatePassport_ShouldReturnNumberOfValidPassports_WhenIteratedOverInputData() { var input = File.ReadAllText("Inputs\\day04.txt"); var sut = new PassportProcessing(); var passportsData = sut.ParseInputData(input); var count = passportsData.Count(pd => sut.ValidatePassport(pd)); count.Should().Be(101); }