Esempio n. 1
0
        public void GetCircleArea()
        {
            var circleObj = new Circle();

            circleObj.MainSide = 1;

            var circle   = new AreaCalculator(circleObj);
            var expected = 3.14;

            var result = circle.GetCircleArea();

            Assert.Equal(expected, result);
        }
Esempio n. 2
0
 public double GetShape(IShape shape)
 {
     if (shape is Circle)
     {
         AreaCalculator areaCalculator = new AreaCalculator((Circle)shape);
         var            areaOfCircle   = areaCalculator.GetCircleArea();
         return(areaOfCircle);
     }
     else
     {
         AreaCalculator areaCalculator = new AreaCalculator((Triangle)shape);
         var            areaOfTriangle = areaCalculator.GetTriangleArea();
         return(areaOfTriangle);
     }
 }