public void ReturnsNullForParallelLines(double slope, double yIntersect1, double yIntersect2) { var line1 = new LinearFunction(slope, yIntersect1); var line2 = new LinearFunction(slope, yIntersect2); var intersection = line1.GetIntersection(line2); Assert.IsNull(intersection); }
public void ReturnsCorrectAnswerForNonParallelLines( double slope1, double intersect1, double slope2, double intersect2, double expectedValue) { var line1 = new LinearFunction(slope1, intersect1); var line2 = new LinearFunction(slope2, intersect2); var intersection = line1.GetIntersection(line2); Assert.IsNotNull(intersection); Assert.AreEqual(expectedValue, intersection.Value); }