public void LineSegment_ContainsOnInsideLineSegment_ShouldReturnTrue_IfBothEndPointsOfPassedAreOnInsideOfInstanceSegment() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(3, 3, 3)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(1, 1, 1), Point.MakePointWithInches(2, 2, 2)); lineSegment1.ContainsOnInside(lineSegment2).Should().BeTrue(); }
public void LineSegment_ContainsOnInsideLineSegment_ShouldThrowException_IfPassedLineSegmentIsNull() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(1, 1, 1)); LineSegment lineSegment2 = null; Action contains = () => lineSegment1.ContainsOnInside(lineSegment2); contains.ShouldThrow<Exception>(); }
public void LineSegment_ContainsOnInsideLineSegment_ShouldReturnFalse_IfEndPointOfPassedSegmentIsNotOnInsideOfInstanceSegment() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(2, 2, 2)); LineSegment lineSegment2 = new LineSegment(Point.MakePointWithInches(1, 1, 1), Point.MakePointWithInches(2, 2, 2)); lineSegment1.ContainsOnInside(lineSegment2).Should().BeFalse(); }
public void LineSegment_ContainsPoint_ShouldReturnThrowException_IfPointIsNull() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(2, 2, 2)); Point point = null; Action contains = () => lineSegment.ContainsOnInside(point); contains.ShouldThrow<NullReferenceException>(); }
public void LineSegment_ContainsOnInsidePoint_ShouldReturnTrue_IfPointIsOnInsideOfSegment() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(2, 2, 2)); Point point = Point.MakePointWithInches(1, 1, 1); lineSegment.ContainsOnInside(point).Should().BeTrue(); }
public void LineSegment_ContainsOnInsidePoint_ShouldReturnFalse_IfPointIsAfterSegmentEndPoint() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Point point = Point.MakePointWithInches(2, 2, 2); lineSegment.ContainsOnInside(point).Should().BeFalse(); }
public void LineSegment_ContainsOnInsidePoint_ShouldReturnFalse_IfPointIsBeforeSegmentBasePoint() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Point point = Point.MakePointWithInches(-1, -1, -1); lineSegment.ContainsOnInside(point).Should().BeFalse(); }