public void TestTrackPosition(int xPos, int yPos) { positionTracker.SetPosition(xPos, yPos); (int x, int y) = positionTracker.GetPosition(); x.ShouldBe(xPos); y.ShouldBe(yPos); }
/// <summary> /// Reports on the position of the robot. If the Robot has not yet been placed, then the PositionReport property <tt>HasRobotBeenPlaced</tt> will be <tt>false</tt> /// </summary> /// <returns></returns> public PositionReport Report() { var(positionX, positionY) = _positionTracker.GetPosition(); if (!_positionTracker.HasRobotBeenPlaced) { return(new PositionReport()); } return(new PositionReport { Orientation = _positionTracker.GetOrientation(), PositionX = positionX, PositionY = positionY, HasRobotBeenPlaced = _positionTracker.HasRobotBeenPlaced }); }