示例#1
0
        public void GetCostTest()
        {
            float expectedResult = 50;
            float actualresult   = prices.GetCost((int)ComponentType.WALL);

            Assert.AreEqual(expectedResult, actualresult);
        }
        private void AddWallsCost(BlueprintCostReport report, IBlueprint aBlueprint)
        {
            float wallMetersCount = 0;

            foreach (Wall existent in aBlueprint.GetWalls())
            {
                wallMetersCount += existent.Length();
            }
            float wallPrice = costsNPrices.GetCost((int)ComponentType.WALL);

            report.SetTotalCost(ComponentType.WALL, wallMetersCount * wallPrice);
        }
 public float GetCost(int componentType)
 {
     return(catalog.GetCost(componentType));
 }