ldc-arcadia-api/tests/Unit/Domain/Models/ValueObjects/IncoCompo/NutrientValueTest.php
Jérémy Munsch 152ee2b5a2
feat(api): add IncoSheets feature with DDD clean architecture, tests & OpenAPI spec
- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection)
- Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase)
- Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory
- Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests
- Docs: updated Bruno collection and OpenAPI spec
2026-08-14 11:33:05 +02:00

29 lines
831 B
PHP

<?php
declare(strict_types=1);
namespace Tests\Unit\Domain\Models\ValueObjects\IncoCompo;
use Domain\Models\ValueObjects\IncoCompo\NutrientValue;
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('<');
});
});