public void LineSegment_OverlappingSegment_ShouldThrowException_IfPassedSegmentIsNull() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(1, 1, 1)); LineSegment lineSegment2 = null; Action intersection = () => lineSegment1.OverlappingSegment(lineSegment2); intersection.ShouldThrow<Exception>(); }
public void LineSegment_OverlappingSegment_ShouldReturnNull_IfOnlyOneEndPointInCommon() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(1, 1, 1)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(1, 1, 1), Point.MakePointWithInches(2, 2, 2)); lineSegment1.OverlappingSegment(lineSegment2).Should().BeNull(); }
public void LineSegment_OverlappingSegment_ShouldReturnIntersection_IfBothInstancePointsAreOnInsideOfPassedSegment() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(1, 1, 1), Point.MakePointWithInches(2, 2, 2)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(3, 3, 3)); lineSegment1.OverlappingSegment(lineSegment2).Should().Be(new LineSegment(Point.MakePointWithInches(1, 1, 1), Point.MakePointWithInches(2, 2, 2))); }
public void LineSegment_OverlappingSegment_ShouldReturnIntersection_IfPassedTwoEndPointsAreTheSame() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(3, 3, 3)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(2, 2, 2)); lineSegment1.OverlappingSegment(lineSegment2).Should().Be(new LineSegment(Point.MakePointWithInches(2, 2, 2))); }
public void LineSegment_OverlappingSegment_ShouldReturnNull_IfOnlyInstanceEndPointIsOnPassedSegment() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(0, 2, 0), Point.MakePointWithInches(1, 1, 1)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(2, 2, 2)); lineSegment1.OverlappingSegment(lineSegment2).Should().BeNull(); }