public void RotateRoverFromWest_InvalidRotationPoint() { var mock = new Moq.Mock <IRoverPosition>(); mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.West); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Assert.AreNotEqual <int>((int)mock.Object.RoverFacingPosition, (int)RoverFacing.North); }
public void MoveRoverOutOfGtrid_North() { var mock = new Moq.Mock <IRoverPosition>(); mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.North); mock.SetupProperty(m => m.RoverPositionX, 0); mock.SetupProperty(m => m.RoverPositionY, 0); Rover.ExecuteCommand("F", mock.Object); Assert.AreEqual <int>(mock.Object.RoverPositionX, 0); Assert.AreEqual <int>(mock.Object.RoverPositionY, 0); }
public void RotateRoverRightFromNorthToNorth() { var mock = new Moq.Mock <IRoverPosition>(); mock.SetupProperty(m => m.RoverFacingPosition, RoverFacing.North); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Rover.ExecuteCommand("R", mock.Object); Assert.AreEqual <int>((int)mock.Object.RoverFacingPosition, (int)RoverFacing.North); }