public void ScaleTest() { var c = new CompositeShape(); var rpoint1 = new Point(1, 1); var rpoint2 = new Point(2, 1); var rpoint3 = new Point(2, 2); var rpoint4 = new Point(1, 2); var rect = new Rectangle(rpoint1, rpoint2, rpoint3, rpoint4); c.Add(rect); var tpoint1 = new Point(0, 0); var tpoint2 = new Point(1, 0); var tpoint3 = new Point(0, 1); var triangle = new Triangle(tpoint1, tpoint2, tpoint3); c.Add(triangle); var area = c.ComputeArea() * 2; c.Scale(2); Assert.Less(Math.Abs(c.ComputeArea() - area), .000000000000001); }