public void LineSegment_HypotheticalIntersectionTest_ShouldThrowNullPointerException_IfLineIsNull() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Line line = null; Action intersect = () => lineSegment.HypotheticalIntersection(line); intersect.ShouldThrow<Exception>(); }
public void LineSegment_HypotheticalIntersectionTest_ShouldReturnLineIntersection() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(-5, -5, 0)); Line line = new Line(Point.MakePointWithInches(5, -4, 0), Point.MakePointWithInches(-5, 6, 0)); lineSegment.HypotheticalIntersection(line).Should().Be(Point.MakePointWithInches(.5, .5, 0)); }