Esempio n. 1
0
        public PartOne(ITestOutputHelper output)
        {
            var recorder = output.ToComputationRecorder();

            _optCodeComputer = new OptCodeComputer(recorder, 1);
            this.output      = output;
        }
Esempio n. 2
0
        public void Output()
        {
            int[] sequence = new int[] { 4, 1, 99 };

            var recorder    = output.ToComputationRecorder();
            var optComputer = new OptCodeComputer(recorder, 1);

            optComputer.Output(ref sequence);
        }
Esempio n. 3
0
        public void Input()
        {
            int[]     sequence = new int[] { 3, 2, 0 };
            const int input    = 99;

            int[] expectedResult = new int[] { 3, 2, input };

            var recorder    = output.ToComputationRecorder();
            var optComputer = new OptCodeComputer(recorder, input);

            optComputer.Output(ref sequence);

            sequence.Should().BeEquivalentTo(expectedResult);
        }
Esempio n. 4
0
        public PartTwo()
        {
            var recorder = _instructions.ToComputationRecorder();

            _optCodeComputer = new OptCodeComputer(recorder, 5);
        }