Ejemplo n.º 1
0
 /**
  * @param Building $building
  * @param $type
  * @return float|int
  */
 public function countPrice(Building $building, $type)
 {
     $priceConstant = $this->getPriceConstant($type);
     $timeConstant = $this->getTimeConstant($type);
     $currentCondition = $building->getCurrentCondition();
     $price = $priceConstant * $timeConstant * $currentCondition;
     return $price;
 }
 public function it_should_count_price(Building $building)
 {
     $building->getCurrentCondition()->willReturn(50);
     $type = BuildingRepair::TYPE_VERY_FAST_ID;
     $this->countPrice($building, $type)->shouldReturn(3600);
 }