public void Run_ShouldHandleMultipleActions() { var action = new RotateAction(_robot, _mapProvider, RotateDirection.Right); action.Run(); action.Run(); Assert.Equal(Direction.North, _robot.Direction); }
public void Run_ShouldRotateToSameDirection() { var action = new RotateAction(_robot, _mapProvider, RotateDirection.Right); action.Run(); action.Run(); action.Run(); action.Run(); Assert.Equal(Direction.South, _robot.Direction); }
public void Run_ShouldNotThrowException__IfRobotNotPlaced() { _robot.Position = null; var action = new RotateAction(_robot, _mapProvider, RotateDirection.Left); action.Run(); }
public void Run_ShouldNotChangePosition() { var action = new RotateAction(_robot, _mapProvider, RotateDirection.Left); action.Run(); Assert.Equal(3, _robot.Position.Latitude); Assert.Equal(2, _robot.Position.Longitude); }
public void Run_ShouldUpdateDirection_WhenRotateLeft(Direction robotDirection, Direction expectedDirection) { _robot.Direction = robotDirection; var action = new RotateAction(_robot, _mapProvider, RotateDirection.Left); action.Run(); Assert.Equal(expectedDirection, _robot.Direction); }