예제 #1
0
        public void LoopTest()
        {
            var day = new Day08();

            day.Input = day.GetInput(file: "test.txt", pattern: "\r\n");
            day.ParseOperations();
            long acc = 0;

            day.ItLooped(day.Instructions, ref acc).Should().BeFalse();
        }
예제 #2
0
        public void ChangeTest(int index, Operation operation, Operation changed, int argument)
        {
            var day = new Day08();

            day.Input = day.GetInput(file: "test.txt", pattern: "\r\n");
            day.ParseOperations();
            day.ChangeIt(day.Instructions, index);
            day.Instructions[index].operation.Should().Be(changed);
            day.Instructions[index].argument.Should().Be(argument);
            day.ChangeIt(day.Instructions, index);
            day.Instructions[index].operation.Should().Be(operation);
            day.Instructions[index].argument.Should().Be(argument);
        }