Пример #1
0
        public void PasswordIsCorrect(string doorId, int length, int charactersToFill,
                                      int index, string expected)
        {
            var sut = new Day5Part2(doorId, length);

            var actual = sut.GetPassword(charactersToFill, index);

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void TestPart2(string program, string input, string expectedOutput)
        {
            var splitInput = input.Split(",", StringSplitOptions.RemoveEmptyEntries);
            var testIO     = new TestIOSystem(splitInput);

            var day1 = new Day5Part2(testIO);
            var val  = day1.RunProgram(program);

            var result = testIO.GetAllInput().FirstOrDefault() ?? "";

            result.ShouldBe(expectedOutput);
        }