public void Test3(string instructions, int expectedDistance) { var sut = new ShipWithWaypoint(instructions); sut.ExecuteInstructions(); Assert.Equal(expectedDistance, sut.ManhattanDistance); }
public void SolveSecondPuzzle() { var sut = new ShipWithWaypoint(PuzzleData.PUZZLE_DATA); sut.ExecuteInstructions(); Assert.Equal(62434, sut.ManhattanDistance); }
Determine_Manhattan_distance_between_ships_with_waypoint_starting_position_and_instructions_location( string navigationInstructionsDescription, int expectedManhattanDistance) { // Given var navigationInstructions = NavigationInstructionsParser.Parse(navigationInstructionsDescription); var ship = new ShipWithWaypoint(new Waypoint(10, 1), 0, 0); // When foreach (var navigationInstruction in navigationInstructions) { ship.Navigate(navigationInstruction); } var actualManhattanDistance = ship.GetManhattanDistance(); // Then Assert.Equal(expectedManhattanDistance, actualManhattanDistance); }