public void LineSegment_Shift_ShouldThrowException_IfShiftIsNull() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Shift shift = null; Action shiftAction = () => lineSegment.Shift(shift); shiftAction.ShouldThrow<Exception>(); }
public void LineSegment_Translate_ShouldThrowException_IfTranslateIsNull() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Translation translation = null; Action translate = () => lineSegment.Shift(translation); translate.ShouldThrow<Exception>(); }
public void LineSegment_Shift_ShouldShiftAsVector() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1)); Shift shift1 = new Shift(new Vector(Point.MakePointWithInches(0, 1, 0))); Shift shift2 = new Shift(new Vector(Point.MakePointWithInches(2, 0, 3))); Shift shift3 = Shift.Compose(shift1, shift2); lineSegment.Shift(shift3).Should().Be(new LineSegment(Point.MakePointWithInches(2, 1, 3), Point.MakePointWithInches(3, 2, 4))); }