Slide 30
Slide 30 text
class ProductUnitPriceTest extends TestCase
{
public function testConstruct(): void
{
$expectedValue = $this->faker()->numberBetween(0);
$unitPrice = new Product\UnitPrice($expectedValue);
$this->assertEquals($expectedValue, $unitPrice->value());
}
public function testConstructFail(): void
{
$this->expectException(\InvalidArgumentException::class);
$invalidValue = $this->faker()->numberBetween(-2147483647, -1);
new Product\UnitPrice($invalidValue);
}
}
ྫʣ୯Ձͷςετ
ਖ਼ৗܥʢWBMVFʣ
ҟৗܥʢWBMVFʣ