Пример #1
0
        public void handle_acc_operation_returns_next_line_of_1_more()
        {
            var state = new Day08Task1.State(123, 10);
            var acc   = new Day08Task1.Acc(124);

            var result = acc.Handle(state);

            result.NextLine.Should().Be(11);
        }
Пример #2
0
        public void handle_acc_operation_sets_was_executed_flag()
        {
            var state = new Day08Task1.State(123, 10);
            var acc   = new Day08Task1.Acc(124);

            acc.WasExecuted.Should().BeFalse();
            var result = acc.Handle(state);

            acc.WasExecuted.Should().BeTrue();
        }
Пример #3
0
        public void handle_acc_operation_changes_accumulator_value(int value)
        {
            var startingAccumulatorValue = 123;
            var state = new Day08Task1.State(startingAccumulatorValue, 10);
            var acc   = new Day08Task1.Acc(value);

            var result = acc.Handle(state);

            result.Accumulator.Should().Be(startingAccumulatorValue + value);
        }