public void Equals_CompareToPoint2D_ExpectedTrue()
        {
            EmptyShape2D emptyShape = new EmptyShape2D();
            Point2D      point      = new Point2D(0, 0);

            Assert.That(!emptyShape.Equals(point));
        }
        public void Equals_CompareToEmptyShape_ExpectedTrue()
        {
            EmptyShape2D emptyShape     = new EmptyShape2D();
            EmptyShape2D comparingShape = new EmptyShape2D();

            Assert.That(emptyShape.Equals(comparingShape));
        }
예제 #3
0
        public void IntersectingShapeWithLineSegment_NoIntersection_ExpectedEmptyShape()
        {
            LineSegment2D lineSegment1 = new LineSegment2D(new Point2D(0, 0), new Point2D(10, 10));
            LineSegment2D lineSegment2 = new LineSegment2D(new Point2D(40, 40), new Point2D(30, 50));
            Shape2D       expectedIntersectingShape = new EmptyShape2D();

            Shape2D actualIntersectingShape = lineSegment1.IntersectingShape(lineSegment2);

            Assert.That(expectedIntersectingShape.Equals(actualIntersectingShape));
        }
예제 #4
0
        public void IntersectingShapeWithRay_NoIntersection_ExpectedEmptyShape()
        {
            LineSegment2D lineSegment = new LineSegment2D(new Point2D(0, 0), new Point2D(10, 0));
            Ray2D         ray         = new Ray2D(new Point2D(0, 10), new Point2D(10, 0));
            Shape2D       expectedIntersectingShape = new EmptyShape2D();

            Shape2D actualIntersectingShape = lineSegment.IntersectingShape(ray);

            Assert.That(expectedIntersectingShape.Equals(actualIntersectingShape));
        }