ldc-arcadia-api/tests/Unit/Domain/Models/ValueObjects/Inco/Composition/FreshProduceAndNutsTest.php

30 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\Inco\Composition;
use Domain\Models\ValueObjects\Inco\Composition\FreshProduceAndNuts;
use Domain\Models\ValueObjects\Inco\Composition\FruitAndNutAmount;
use Domain\Models\ValueObjects\Inco\Composition\PercentageValue;
covers(FreshProduceAndNuts::class);
describe('FreshProduceAndNuts Value Object', function (): void {
it('can be instantiated with reference and portion fruit and nut amounts', function (): void {
// GIVEN
$reference = new FruitAndNutAmount('50', '25');
$portion = new FruitAndNutAmount('10', '5');
$fresh = new PercentageValue('10%');
$fruits = new PercentageValue('40%');
// WHEN
$freshProduce = new FreshProduceAndNuts($reference, $portion, $fresh, $fruits);
// THEN
expect($freshProduce->reference)->toBe($reference)
->and($freshProduce->portion)->toBe($portion)
->and($freshProduce->freshFnlPercentage)->toBe($fresh)
->and($freshProduce->fruitsPercentage)->toBe($fruits);
});
});