41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Domain\Models\ValueObjects\Inco\Composition;
|
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\CarbohydratesDetail;
|
|
|
|
covers(CarbohydratesDetail::class);
|
|
|
|
describe('CarbohydratesDetail Value Object', function (): void {
|
|
it('can be instantiated with carbohydrates details', function (): void {
|
|
// GIVEN & WHEN
|
|
$detail = new CarbohydratesDetail(
|
|
starch: '10.5',
|
|
maltodextrin: '1.0',
|
|
sucrose: '5.0',
|
|
glucose: '3.0',
|
|
lactose: '0.0',
|
|
maltose: '1.0',
|
|
galactose: '0.0',
|
|
carbohydrateHydrates: '0.0',
|
|
boundFructose: '0.0',
|
|
freeFructose: '2.5',
|
|
oligosaccharides: '0.0',
|
|
polyols: '0.0',
|
|
solubleFiber: '0.0',
|
|
inositol: '0.0',
|
|
);
|
|
|
|
// THEN
|
|
expect($detail->starch)->toBe('10.5')
|
|
->and($detail->sucrose)->toBe('5.0')
|
|
->and($detail->freeFructose)->toBe('2.5')
|
|
->and($detail->glucose)->toBe('3.0')
|
|
->and($detail->lactose)->toBe('0.0')
|
|
->and($detail->maltose)->toBe('1.0')
|
|
->and($detail->polyols)->toBe('0.0')
|
|
->and($detail->galactose)->toBe('0.0');
|
|
});
|
|
});
|