public void GetCostWallsTest() { BlueprintCostReport report = reporter.GenerateCostReport(toReport); float expectedResult = 500; float actualResult = report.GetTotalCost(ComponentType.WALL); Assert.AreEqual(expectedResult, actualResult); }
//Auxiliar private void calulateCostsAndPrices() { IPriceCostRepository pricesNcosts = new PriceCostRepository(); BlueprintReportGenerator reportGenerator = new BlueprintReportGenerator(pricesNcosts); BlueprintCostReport costReport = reportGenerator.GenerateCostReport(selectedBluePrint); BlueprintPriceReport priceReport = reportGenerator.GeneratePriceReport(selectedBluePrint); if (CurrentSession.UserLogged.HasPermission(Permission.VIEW_COSTS)) { lblWallsTotalCost.Text = costReport.GetTotalCost(ComponentType.WALL) + ""; lblBeamsTotalCost.Text = costReport.GetTotalCost(ComponentType.BEAM) + ""; lblDoorsTotalCost.Text = costReport.GetTotalCost(ComponentType.DOOR) + ""; lblWindowsTotalCost.Text = costReport.GetTotalCost(ComponentType.WINDOW) + ""; lblColumnsTotalCost.Text = costReport.GetTotalCost(ComponentType.COLUMN) + ""; lblTotalCostSum.Text = (costReport.GetTotalCost(ComponentType.WALL) + costReport.GetTotalCost(ComponentType.BEAM) + costReport.GetTotalCost(ComponentType.DOOR) + costReport.GetTotalCost(ComponentType.WINDOW)) + costReport.GetTotalCost(ComponentType.COLUMN) + ""; } lblWallsPrice.Text = priceReport.GetTotalPrice(ComponentType.WALL) + ""; lblBeamsPrice.Text = priceReport.GetTotalPrice(ComponentType.BEAM) + ""; lblDoorsPrice.Text = priceReport.GetTotalPrice(ComponentType.DOOR) + ""; lblWindowsPrice.Text = priceReport.GetTotalPrice(ComponentType.WINDOW) + ""; lblColumnsTotalPrice.Text = priceReport.GetTotalPrice(ComponentType.COLUMN) + ""; lblTotalPriceSum.Text = (priceReport.GetTotalPrice(ComponentType.WALL) + priceReport.GetTotalPrice(ComponentType.BEAM) + priceReport.GetTotalPrice(ComponentType.DOOR) + priceReport.GetTotalPrice(ComponentType.WINDOW)) + priceReport.GetTotalPrice(ComponentType.COLUMN) + ""; }