Example #1
0
        public void TestGetAreaOfCircle(double radius, double expectedArea)
        {
            Circle paperCircle    = new PaperCircle(radius);
            Circle membraneCircle = new MembraneCircle(radius);

            Assert.AreEqual(expectedArea, paperCircle.GetArea());
            Assert.AreEqual(expectedArea, membraneCircle.GetArea());
        }
Example #2
0
        public void TestFindTotalAreaInBox(double radius, double newRadius, int index)
        {
            Box    box          = new Box();
            Circle firstCircle  = new MembraneCircle(radius);
            Circle secondCircle = new PaperCircle(newRadius);

            Assert.AreEqual(0, box.GetTotalArea());
            box.AddShape(firstCircle);
            box.AddShape(secondCircle);
            Assert.AreEqual(firstCircle.GetArea() + secondCircle.GetArea(), box.GetTotalArea());
        }