Beispiel #1
0
        public void Run_BadShapePrinter_Example()
        {
            var badPrinter = new ShapePrinter();

            var rectangle = new Rectangle { Height = 10, Length = 20 };
            var circle = new Circle { Radius = 5 };

            badPrinter.PrintShapeArea(rectangle);
            badPrinter.PrintShapeArea(circle);
        }
 private double GetCircleArea(Circle circle)
 {
     return Math.PI * circle.Radius * circle.Radius;
 }