public void AndTheCommandIsMoveForwardThenRoverMovedForwardWithLogging() { _roverDecorator.ProcessCommand(Command.MoveForward); _rover.Received(1).MoveForward(); _logger.Received(1).Log("Rover moved forward."); _logger.Received(1).Log(Arg.Is <string>(s => s.StartsWith("Rover is at "))); }
public void SendLongCommand_ExpectedCalls() { IRover mockedRover = Substitute.For <IRover>(); IRoverCommander commander = new RoverCommander(mockedRover); commander.SendCommands("MRLLRRMMMLL"); mockedRover.Received(4).Move(); mockedRover.Received(3).RotateCW(); mockedRover.Received(4).RotateCCW(); }
public void SendCommand_M_Move() { IRover mockedRover = Substitute.For <IRover>(); IRoverCommander commander = new RoverCommander(mockedRover); commander.SendCommand('M'); mockedRover.Received(1).Move(); }
public void SendCommand_R_RotateRoverCW() { IRover mockedRover = Substitute.For <IRover>(); IRoverCommander commander = new RoverCommander(mockedRover); commander.SendCommand('R'); mockedRover.Received(1).RotateCW(); }