public void CanCalculateManhattanDistances() { var inputA = new Day6.Coordinate(1, 1); var inputB = new Day6.Coordinate(2, 2); var result = Day6.GetDistance(inputA, inputB); Assert.Equal(2, result); }
public void CanCalculateManhattanDistancesRegardlessOfDirection() { var inputA = new Day6.Coordinate(10, 2); var inputB = new Day6.Coordinate(2, 2); var inputC = new Day6.Coordinate(2, 2); var inputD = new Day6.Coordinate(2, 10); var resultA = Day6.GetDistance(inputA, inputB); var resultB = Day6.GetDistance(inputB, inputA); var resultC = Day6.GetDistance(inputC, inputD); var resultD = Day6.GetDistance(inputD, inputC); Assert.Equal(8, resultA); Assert.Equal(8, resultB); Assert.Equal(8, resultC); Assert.Equal(8, resultD); }