public void ShouldFollowWaypointInstructionsAndCalculateManhattanDistance() { // Arrange var instructions = new List <string> { "F10", "N3", "F7", "R90", "F11" }; var navigationSystem = new NavigationSystem(CreateFerry(), instructions); // Act var distance = navigationSystem.CalculateManhattanDistance(); // Assert distance.Should().Be(286); }
public void ShouldExecuteAllPossibleInstructionsAndCalculateManhattanDistance() { // Arrange var instructions = new List <string> { "N100", "S10", "E100", "W10", "F10", "R90", "F10", "L90", "F10" }; var navigationSystem = new NavigationSystem(CreateShip(), instructions); // Act var distance = navigationSystem.CalculateManhattanDistance(); // Assert distance.Should().Be(190); }