public function testShowChargeUsecaseReturnsExtraChargeCaseSummer()
 {
     $userDate = '2014-07-01';
     $quantity = 4;
     $fixture = new UserUsage($userDate, $quantity);
     $app = new ApplicationConfig();
     $usecase = new ShowChargeUsecase($app->getConfig());
     $expected = 8000 * 4 * 0.9;
     $this->assertSame((int) $expected, $usecase->run($fixture));
 }
Ejemplo n.º 2
0
<?php

require __DIR__ . '/../vendor/autoload.php';
use Sample\ExpressionLanguage\Usecase\ShowChargeUsecase;
use Sample\ExpressionLanguage\Data\UserUsage;
use Sample\ExpressionLanguage\Config\ApplicationConfig;
$app = new ApplicationConfig();
$usecase = new ShowChargeUsecase($app->getConfig());
//fixture
$userDate = '2014-09-17';
$quantity = 2;
$input = new UserUsage($userDate, $quantity);
var_dump($usecase->run($input));