Beispiel #1
0
        public void Then_the_numbers_are_multiplied()
        {
            var testString = "1,9,10,3,2,3,11,0,99,30,40,50";
            var memory     = new IntcodeMemory(testString);
            var sut        = new Intcode.Intcode(memory);

            sut.ProcessInstructions();

            var result   = memory.GetValue(0);
            var expected = 3500;

            Assert.That(result, Is.EqualTo(expected));
        }
Beispiel #2
0
        public void Then_result_at_position_zero_is_correct()
        {
            var testFilePath = "..//..//..//TestData//day02.txt";

            var initialState = File.ReadLines(testFilePath).First();

            _memory = new IntcodeMemory(initialState);

            _intCode = new Intcode.Intcode(_memory);

            var nounVerb = _intCode.FindNounVerb(_expectedOutput);

            var result = _memory.GetValue(0);

            Assert.That(result, Is.EqualTo(_expectedOutput));

            Assert.That(nounVerb, Is.EqualTo(4847));
        }
Beispiel #3
0
        public void Then_result_at_position_zero_is_correct()
        {
            var result = _memory.GetValue(0);

            Assert.That(result, Is.EqualTo(5110675));
        }