public double Calculate_EqualNumberOfCoordinateValues_ReturnsValidValue( int[] fromVertexCoordinateValues, int[] toVertexCoordinateValues) { coordinateFromMock.Setup(coordinate => coordinate.CoordinatesValues).Returns(fromVertexCoordinateValues); vertexFromMock.Setup(vertex => vertex.Position).Returns(coordinateFromMock.Object); coordinateToMock.Setup(coordinate => coordinate.CoordinatesValues).Returns(toVertexCoordinateValues); vertexToMock.Setup(vertex => vertex.Position).Returns(coordinateToMock.Object); return(manhattanDistance.Calculate(FirstVertex, SecondVertex)); }
public void Test2() { var input = File.ReadAllLines("input.txt"); var actualDistance = ManhattanDistance.Calculate(input[0], input[1]); actualDistance.Should().Be(0, because: "It should"); }
public void TestDistanceCalc() { ICalculateDistance calc = new ManhattanDistance(); double[] pos1 = { 0.5, 1.0, 2.5 }; double[] pos2 = { 0.1, 2.0, -2.5 }; Assert.AreEqual(6.4, calc.Calculate(pos1, pos2), 0.001); }
public void Test1(string wire1, string wire2, int expectedDistance) { var actualDistance = ManhattanDistance.Calculate(wire1, wire2); actualDistance.Should().Be(expectedDistance, because: "It should"); }