Ejemplo n.º 1
0
        public void RemoveAllShapes()
        {
            var c       = new CompositeShape();
            var rpoint1 = new Point(20, 20);
            var rpoint2 = new Point(30, 20);
            var rpoint3 = new Point(30, 30);
            var rpoint4 = new Point(20, 30);
            var rect    = new Rectangle(rpoint1, rpoint2, rpoint3, rpoint4);

            c.Add(rect);
            var tpoint1  = new Point(0, 0);
            var tpoint2  = new Point(3, 0);
            var tpoint3  = new Point(0, 3);
            var triangle = new Triangle(tpoint1, tpoint2, tpoint3);

            c.Add(triangle);

            c.RemoveAllShapes();
            Assert.AreEqual(0, c.Points.Count);
            Assert.AreEqual(0, c.thisShapesList.Count);
        }