public void moveAxisBase_CalledWithArgLeft_CallsRobotmoveBase() { // Setup IRobot irMock = MockRepository.GenerateMock<IRobot>(); mcTestObj = new ManualController(); mcTestObj.RobotConnection = irMock; irMock.Stub(t => t.moveBase(Arg<int>.Is.Anything)).Return(true); // Test mcTestObj.moveAxisBase(enumLeftRight.MANUAL_MOVE_LEFT); // Verify irMock.AssertWasCalled(t => t.moveBase(Arg<int>.Is.Anything)); }
public void moveAxisBase_ReturnsFalse_CastExceptions() { // Setup IRobot irMock = MockRepository.GenerateMock<IRobot>(); mcTestObj = new ManualController(); mcTestObj.RobotConnection = irMock; irMock.Stub(t => t.moveBase(Arg<int>.Is.Anything)).Return(false); // Verify Assert.Catch(() => mcTestObj.moveAxisBase(enumLeftRight.MANUAL_MOVE_LEFT)); }