public void LineSegment_Rotate_ShouldRotateAsVector() { LineSegment lineSegment1 = new LineSegment(Point.MakePointWithInches(1, 0, 0)); Rotation rotation = new Rotation(new Angle(45, Angle.Degrees)); LineSegment lineSegment2 = lineSegment1.Rotate(rotation); lineSegment2.Should().Be(new LineSegment(Point.Origin, new Direction(rotation.RotationAngle), new Distance(Distance.Inches, 1))); }
public void LineSegment_Rotate_ShouldThrowException_IfRotationIsNull() { LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 0, 0)); Rotation rotation = null; Action rotate = () => lineSegment.Rotate(rotation); rotate.ShouldThrow<Exception>(); }
public void Polygon_Rectangle_Constructor() { LineSegment testSegment = new LineSegment(new Vector(Point.Origin, Direction.Left, new Distance(1, Inches))); testSegment = testSegment.Rotate(new Rotation(Line.ZAxis, new Angle(33, Degrees))); Rectangle myRectangle = new Rectangle(testSegment, new Distance(1, Inches)); Area myArea = myRectangle.Area; (myArea == new Area(new SquareInch(), 1)).Should().BeTrue(); myRectangle.IsRectangle().Should().BeTrue(); }