public void ExecuteProgram_ReadsInCorrectly(int[] program, int positionValue, int inputValue)
        {
            mockWriter.Setup(mw => mw.ReadLine()).Returns("2");
            programExecutor = new ProgramExecutor(mockWriter.Object);
            var output = programExecutor.ExecuteProgram(program);

            Assert.Equal(inputValue, output[positionValue]);
        }
        public void ExecuteProgram_OutputsCorrectDiagnosticsCode(int[] program, string readLineOutput,
                                                                 string expectedOutput)
        {
            mockWriter.Setup(mw => mw.ReadLine()).Returns(readLineOutput);
            programExecutor = new ProgramExecutor(mockWriter.Object);
            var output = programExecutor.ExecuteProgram(program);

            mockWriter.Verify(mw => mw.Write(It.Is <string>(s => s.Equals(expectedOutput))));
        }
 public void ExecuteProgram_EqualsOpCodeWorksAsExpected(int[] program, int[] expectedOutput)
 {
     programExecutor = new ProgramExecutor(mockWriter.Object);
     Assert.Equal(expectedOutput, programExecutor.ExecuteProgram(program));
 }
 public void ExecuteProgram_OutputsCorrectDiagnostics(int[] program, string expectedOutput)
 {
     programExecutor = new ProgramExecutor(mockWriter.Object);
     programExecutor.ExecuteProgram(program);
     mockWriter.Verify(mw => mw.Write(It.Is <string>((t => t.Equals(expectedOutput)))));
 }
 public void ExecuteProgram_CorrectlyParsesProgram(int[] program, int[] expectedOutput)
 {
     programExecutor = new ProgramExecutor(mockWriter.Object);
     Assert.Equal(expectedOutput, programExecutor.ExecuteProgram(program));
 }
 public void Test1(int[] program, int[] expectedOutput)
 {
     Assert.Equal(expectedOutput, programExecutor.ExecuteProgram(program));
 }