public void TAC_TestNegativeNumber_OutputOne() { EnqueTestProgram_Return999WhenNegative(); computer.Enqueue(-001); computer.Execute(); Assert.AreEqual(1, computer.Output.Count); Assert.AreEqual(ResultWhen_Negative, computer.Output.Dequeue()); }
public void ProgramNo1_AddNumberA_toNumberB_toProduceSumS() { loader.EnqueueProgram( 034, 035, 134, 235, 636, 536, 900 ); computer.Enqueue(032); computer.Enqueue(109); computer.Execute(); Assert.AreEqual(1, computer.Output.Count); Assert.AreEqual(141, computer.Output.Dequeue()); }
private void TestProgram(int shiftOperation, int input, int expectedOutput) { loader.EnqueueProgram( 020, 120, shiftOperation, 620, 520, 900 ); computer.Enqueue(input); computer.Execute(); Assert.AreEqual(1, computer.Output.Count); Assert.AreEqual(expectedOutput, computer.Output.Dequeue()); }
public void Cardiac_ReadInputAndStopWithoutCrash() { computer.Enqueue(900); computer.Execute(); Assert.AreEqual(0, computer.Output.Count); }