public void DistanceTraveledShortest(double xPos, double yPos, double expected) { // This should yield a distance of 5. var testCoord = new GridCoordinate(xPos, yPos); var shortestResult = testCoord.DistanceTraveledFromOrigin(DistanceCalculationMode.ShortestPath); Assert.Equal(expected, shortestResult); }
public void DistanceTraveledXandYComponents(double xPos, double yPos) { var testCoord = new GridCoordinate(xPos, yPos); var addedResult = testCoord.DistanceTraveledFromOrigin(DistanceCalculationMode.XComponentPlusYComponent); double expected = Math.Abs(xPos) + Math.Abs(yPos); Assert.Equal(expected, addedResult); }