コード例 #1
0
        public void NoCommands_ReturnsStartPosition()
        {
            //Act
            var result = _roverController.Execute("");

            //Assert
            Assert.That(result, Is.EqualTo("0:0:N"));
        }
コード例 #2
0
        public void GivenAnObstacle_RoverStopsAndReportsLastLocation(string input, string obstacleLocation,
                                                                     string expectedOutput)
        {
            //Arrange
            var obstacle = RoverTestHelper.ConvertCoordinateStringToCoordinate(obstacleLocation);
            var grid     = new Grid(0, 10, 0, 10, obstacle);

            _roverController = new MarsRoverController(grid);

            //Act
            var result = _roverController.Execute(input);

            //Assert
            Assert.That(result, Is.EqualTo(expectedOutput));
        }