2026-08-14 11:33:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-08-14 15:38:10 +02:00
|
|
|
namespace Tests\Unit\Domain\Models\ValueObjects\Inco\Composition;
|
2026-08-14 11:33:05 +02:00
|
|
|
|
2026-08-14 15:38:10 +02:00
|
|
|
use Domain\Models\ValueObjects\Inco\Composition\NutrientValue;
|
2026-08-14 11:33:05 +02:00
|
|
|
|
|
|
|
|
covers(NutrientValue::class);
|
|
|
|
|
|
|
|
|
|
describe('NutrientValue Value Object Unit Tests', function (): void {
|
|
|
|
|
it('instantiates NutrientValue with default amount and null precision', function (): void {
|
|
|
|
|
// GIVEN & WHEN
|
|
|
|
|
$nutrient = new NutrientValue();
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($nutrient->amount)->toBe('0')
|
|
|
|
|
->and($nutrient->precision)->toBeNull();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('instantiates NutrientValue with custom amount and precision', function (): void {
|
|
|
|
|
// GIVEN & WHEN
|
|
|
|
|
$nutrient = new NutrientValue('12.5', '<');
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($nutrient->amount)->toBe('12.5')
|
|
|
|
|
->and($nutrient->precision)->toBe('<');
|
|
|
|
|
});
|
|
|
|
|
});
|