private void AddWindowsPrice(BlueprintPriceReport report, IBlueprint aBlueprint) { int windowsCount = aBlueprint.GetOpenings().Count(o => o.GetComponentType().Equals(ComponentType.WINDOW)); float windowsPrice = costsNPrices.GetPrice((int)ComponentType.WINDOW); report.SetTotalPrice(ComponentType.WINDOW, windowsCount * windowsPrice); }
private void AddDoorsPrice(BlueprintPriceReport report, IBlueprint aBlueprint) { int doorsCount = aBlueprint.GetOpenings().Count(o => o.GetComponentType().Equals(ComponentType.DOOR)); float doorsPrice = costsNPrices.GetPrice((int)ComponentType.DOOR); report.SetTotalPrice(ComponentType.DOOR, doorsCount * doorsPrice); }
public void ModifyAdditionTest() { BuildTestBlueprint(); portfolio.Add(blueprint1); blueprint1.RemoveWall(new Point(0, 2), new Point(4, 2)); blueprint1.InsertColumn(new Point(3, 3)); portfolio.Modify(blueprint1); blueprint1 = portfolio.Get(blueprint1.GetId()); bool wallsOk = blueprint1.GetWalls().Count == 1; bool openingsOk = blueprint1.GetOpenings().Count == 1; bool columnsOk = blueprint1.GetColumns().Count == 2; Assert.IsTrue(wallsOk && openingsOk && columnsOk); }