public void SML_Instruction_Incr_Bad_Stack() { Mock <IVirtualMachine> mock = new Mock <IVirtualMachine>(MockBehavior.Strict); Incr incr = new Incr { VirtualMachine = mock.Object }; mock.Setup(m => m.Stack).Returns(new Stack()); incr.Run(); }
public void SML_Instruction_Incr_Bad_Item() { string inputOne = "2"; Stack stack = new Stack(); Mock <IVirtualMachine> mock = new Mock <IVirtualMachine>(MockBehavior.Strict); Incr incr = new Incr { VirtualMachine = mock.Object }; mock.Setup(m => m.Stack).Returns(stack); stack.Push(inputOne); incr.Run(); }
public void SML_Instruction_Incr_Good() { int inputOne = 2; int expected = inputOne + 1; Stack stack = new Stack(); Mock <IVirtualMachine> mock = new Mock <IVirtualMachine>(MockBehavior.Strict); Incr incr = new Incr { VirtualMachine = mock.Object }; mock.Setup(m => m.Stack).Returns(stack); stack.Push(inputOne); incr.Run(); Assert.AreEqual(mock.Object.Stack.Pop(), expected); }