static void Main(string[] args) { var rectangulos = new[] { new Rectangle { Width = 10, Height = 5 }, new Rectangle { Width = 4, Height = 6 }, new Rectangle { Width = 5, Height = 1 }, new Rectangle { Width = 8, Height = 9 } }; var sumaDeAreas = AreaOperations.Sum(rectangulos); var sumaDePerimetros = PerimeterOperations.Sum(rectangulos); Console.WriteLine($"Area total: {sumaDeAreas}" + $"\n Perimetro Total: {sumaDePerimetros}"); Console.ReadKey(); }
public void Sum_Perimeters() { var rectangles = Shapes; double actual = PerimeterOperations.Sum(rectangles); Assert.AreEqual(expectedPerimeter, actual); }
public void Calculate(IEnumerable <IGeometricShape> figuras) { var areaOperations = new AreaOperations(); var perimeterOperations = new PerimeterOperations(); TotalAreas = areaOperations.Sum(figuras); TotalPerimeters = perimeterOperations.Sum(figuras); }
public void Single_Responsability_Principle_Violation() { var rectangles = new[] { new Rectangle { Width = 10, Height = 5 }, new Rectangle { Width = 4, Height = 6 }, new Rectangle { Width = 5, Height = 1 }, new Rectangle { Width = 8, Height = 9 } }; var sumAreas = new AreaOperations().Sum(rectangles); var sumPerimetro = new PerimeterOperations().Sum(rectangles); }
public void Calculate(IEnumerable <IGeometricShape> shapes) { TotalAreas = AreaOperations.Sum(shapes); TotalPerimeters = PerimeterOperations.Sum(shapes); }