diff --git a/tests/Unit/Domain/Models/ValueObjects/BrandCodeTest.php b/tests/Unit/Domain/Models/ValueObjects/BrandCodeTest.php new file mode 100644 index 0000000..d5a2e38 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/BrandCodeTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with([13, 1, 9999]); + + it('rejects zero or negative brand codes', function (int $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new BrandCode($invalid)) + ->toThrow(\DomainException::class); + })->with([0, -1, -9999]); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/EstablishmentCodeTest.php b/tests/Unit/Domain/Models/ValueObjects/EstablishmentCodeTest.php new file mode 100644 index 0000000..776662b --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/EstablishmentCodeTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with(['EST01', '01', 'ESTABLISHMENT', 'A1']); + + it('rejects invalid, lowercase, short or empty establishment codes', function (string $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new EstablishmentCode($invalid)) + ->toThrow(\DomainException::class); + })->with(['est01', 'A', '', 'EST 01', 'EST-01']); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/IncoCompoIdTest.php b/tests/Unit/Domain/Models/ValueObjects/IncoCompoIdTest.php new file mode 100644 index 0000000..7060bdb --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/IncoCompoIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with(['123', '0', '999999']); + + it('rejects invalid non-numeric or empty values', function (string $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new IncoCompoId($invalid)) + ->toThrow(\DomainException::class); + })->with(['abc', '12a', '', ' 123 ', '-5']); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php b/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php new file mode 100644 index 0000000..01d91e2 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/IncoIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with(['100', '1', '88888']); + + it('rejects invalid non-numeric or empty values', function (string $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new IncoId($invalid)) + ->toThrow(\DomainException::class); + })->with(['invalid', '12b', '', ' ', '-1']); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/ServiceIdTest.php b/tests/Unit/Domain/Models/ValueObjects/ServiceIdTest.php new file mode 100644 index 0000000..618c4d9 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/ServiceIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with(['097', '1', '12345']); + + it('rejects non-numeric service identifiers', function (string $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new ServiceId($invalid)) + ->toThrow(\DomainException::class); + })->with(['SERV01', 'abc', '', ' 097 ', '-10']); +}); diff --git a/tests/Unit/Domain/Models/ValueObjects/SiteIdTest.php b/tests/Unit/Domain/Models/ValueObjects/SiteIdTest.php new file mode 100644 index 0000000..ed3e844 --- /dev/null +++ b/tests/Unit/Domain/Models/ValueObjects/SiteIdTest.php @@ -0,0 +1,28 @@ +value)->toBe($value); + })->with(['LDCSER', 'SLELA', 'DDE', 'SITE']); + + it('rejects lowercase, numeric, or too short site identifiers', function (string $invalid): void { + // GIVEN / WHEN / THEN + expect(fn () => new SiteId($invalid)) + ->toThrow(\DomainException::class); + })->with(['site', 'LDCSER01', 'A', '123', '', 'LD CSER']); +});