public void CanMoveAllAround_WhenCommandNotSupported_ShouldThrowException() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); //act rover.MakeCommand("MickeyMouse"); }
public void CanRotateFullCounterClockWise_WhenDirectionIsNorth_OrientationShouldBeNorth() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); //act rover.MakeCommand("LLLL"); //assert Assert.AreEqual(CardinalDirection.North, rover.RoverDirection); }
public void CanRotateLeft_WhenDirectionIsNorth_OrientationShouldBeEast() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); //act rover.MakeCommand("L"); //assert Assert.AreEqual(CardinalDirection.West, rover.RoverDirection); }
public void CanMoveBackwars_WhenAt00FacingEast_CoordinateXEquals99() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.East); //act rover.MakeCommand("B"); //assert Assert.AreEqual(Convert.ToUInt32(99), rover.CoordinateX); }
public void CanMoveForward_WhenAtEdgeFacingNorth_CoordinateYEquals0() { // arrange var rover = new PlutoRover(PlutoRover.SURFACE_SIZE - 1, PlutoRover.SURFACE_SIZE - 1, CardinalDirection.North); //act rover.MakeCommand("F"); //assert Assert.AreEqual(Convert.ToUInt32(0), rover.CoordinateY); }
public void CanMoveBackWardOneField() { // arrange var rover = new PlutoRover(0, 1, CardinalDirection.North); //act rover.MakeCommand("B"); //assert Assert.AreEqual("00North", rover.GetRoverCoordinatesAndDirection()); }
public void CanMoveAndRotateAllAround() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); //act rover.MakeCommand("FFRFF"); //assert Assert.AreEqual("22East", rover.GetRoverCoordinatesAndDirection()); }
public void TryMoveTwoField_WhenObstacleOnSecondField_CanMoveOneFieldAndReportObstacle() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); rover.Surface[0, 2] = 1; //act rover.MakeCommand("FF"); //assert Assert.AreEqual("01North", rover.GetRoverCoordinatesAndDirection()); Assert.IsTrue(rover.ObstacleDetected); }
public void TryMoveOneField_WhenObstacleOnThatField_ShouldReportIt() { // arrange var rover = new PlutoRover(0, 0, CardinalDirection.North); rover.Surface[0, 1] = 1; //act rover.MakeCommand("F"); //assert Assert.AreEqual("00North", rover.GetRoverCoordinatesAndDirection()); Assert.IsTrue(rover.ObstacleDetected); }