public void GivenCommandIsInvalidWhenRoverIsDeployedThenThrowsException(string command) { //Arrange var splitCommand = command.Split(" "); var xPos = Convert.ToInt32(splitCommand[0]); var yPos = Convert.ToInt32(splitCommand[1]); var direction = splitCommand[2]; var _roverDeploymentService = new RoverDeploymentService(plateauService); //Act and Assert var ex = Assert.Throws <Exception>(() => _roverDeploymentService.DeployRover(command)); Assert.AreEqual("Invalid Deployment Command", ex.Message); }
public void GivenCommandIsValidWhenRoverIsDeployedThenReturnsCorrectPosition(string command) { //Arrange var splitCommand = command.Split(" "); var xPos = Convert.ToInt32(splitCommand[0]); var yPos = Convert.ToInt32(splitCommand[1]); var direction = splitCommand[2]; var _roverDeploymentService = new RoverDeploymentService(plateauService); //Act var response = _roverDeploymentService.DeployRover(command); //Assert Assert.AreEqual(xPos, response.XPos); Assert.AreEqual(yPos, response.YPos); Assert.AreEqual(direction, response.Direction.ToString()); }