test(domain): herregistratie inscription date + reminder-due rule (refs #18)

The Registration aggregate gains the herregistratie clock: Approve now records
the inscription moment, from which the herregistratie deadline and a
reminder-due rule are derived. Members are stubbed so the suite compiles and the
new assertions fail; the green commit implements them. Approve's signature gains
the inscription moment (callers now supply 'now' from an injected TimeProvider).

refs #18
This commit is contained in:
not
2026-07-23 11:51:11 +02:00
parent 5f8ab4dbcd
commit dc532dee00
9 changed files with 162 additions and 32 deletions
+12 -9
View File
@@ -4,6 +4,9 @@ namespace Big.Tests;
public class RegistrationTests
{
// A fixed inscription moment for the approval tests; its exact value is irrelevant to them.
private static readonly DateTimeOffset Ingeschreven = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero);
[Fact]
public void Submitting_a_registration_starts_in_ingediend()
{
@@ -103,7 +106,7 @@ public class RegistrationTests
var registration = Registration.Submit("123456782");
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
Assert.Equal(RegistrationStatus.Ingeschreven, registration.Status);
}
@@ -113,7 +116,7 @@ public class RegistrationTests
{
var registration = Registration.Submit("123456782");
var ex = Assert.Throws<InvalidOperationException>(() => registration.Approve());
var ex = Assert.Throws<InvalidOperationException>(() => registration.Approve(Ingeschreven));
Assert.Contains("no zaak", ex.Message, StringComparison.OrdinalIgnoreCase);
Assert.Equal(RegistrationStatus.Ingediend, registration.Status);
@@ -124,9 +127,9 @@ public class RegistrationTests
{
var registration = Registration.Submit("123456782");
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
var ex = Assert.Throws<InvalidOperationException>(() => registration.Approve());
var ex = Assert.Throws<InvalidOperationException>(() => registration.Approve(Ingeschreven));
Assert.Contains("only an INGEDIEND", ex.Message);
Assert.Equal(RegistrationStatus.Ingeschreven, registration.Status);
}
@@ -157,7 +160,7 @@ public class RegistrationTests
{
var registration = Registration.Submit("123456782");
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
var ex = Assert.Throws<InvalidOperationException>(() => registration.TakeIntoBehandeling());
Assert.Contains("only an INGEDIEND", ex.Message);
@@ -171,7 +174,7 @@ public class RegistrationTests
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.TakeIntoBehandeling();
registration.Approve();
registration.Approve(Ingeschreven);
Assert.Equal(RegistrationStatus.Ingeschreven, registration.Status);
}
@@ -218,7 +221,7 @@ public class RegistrationTests
var approveEx = Assert.Throws<InvalidOperationException>(() =>
{
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
});
Assert.Contains("IN_BEHANDELING", approveEx.Message);
@@ -277,7 +280,7 @@ public class RegistrationTests
{
var registration = Registration.Submit("123456782");
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
var ex = Assert.Throws<InvalidOperationException>(() => registration.Withdraw());
Assert.Contains("only an INGEDIEND", ex.Message);
@@ -336,7 +339,7 @@ public class RegistrationTests
{
var registration = Registration.Submit("123456782");
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
registration.Approve();
registration.Approve(Ingeschreven);
var ex = Assert.Throws<InvalidOperationException>(() => registration.Expire());
Assert.Contains("only an INGEDIEND", ex.Message);