Stryker.NET config for the domain service (break 90, the repo's ratchet floor), excluding the OpenZaakJobPump hosted-shell from mutation. Hardened the unit tests to kill survivors — Basic-credential value, variable types, null/failure response paths, option defaults, guard clauses, save counts and log output — leaving only two documented equivalent mutants (Stryker-disabled). make mutation runs the domain ratchet and CI uploads its report alongside the others. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using Big.Domain;
|
|
using Big.Infrastructure;
|
|
|
|
namespace Big.Tests;
|
|
|
|
public class InMemoryRegistrationStoreTests
|
|
{
|
|
[Fact]
|
|
public async Task Saves_and_reads_back_a_registration_by_id()
|
|
{
|
|
var store = new InMemoryRegistrationStore();
|
|
var registration = Registration.Submit("123456782");
|
|
|
|
await store.SaveAsync(registration);
|
|
|
|
var loaded = await store.GetAsync(registration.Id);
|
|
Assert.NotNull(loaded);
|
|
Assert.Equal(registration.Id, loaded.Id);
|
|
Assert.Null(await store.GetAsync(RegistrationId.New()));
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Saving_the_same_id_upserts()
|
|
{
|
|
var store = new InMemoryRegistrationStore();
|
|
var registration = Registration.Submit("123456782");
|
|
await store.SaveAsync(registration);
|
|
|
|
registration.AttachZaak(new Uri("http://openzaak/zaken/api/v1/zaken/abc"));
|
|
await store.SaveAsync(registration);
|
|
|
|
var loaded = await store.GetAsync(registration.Id);
|
|
Assert.NotNull(loaded);
|
|
Assert.Equal("http://openzaak/zaken/api/v1/zaken/abc", loaded.ZaakUrl!.ToString());
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Saving_a_null_registration_is_rejected()
|
|
{
|
|
var store = new InMemoryRegistrationStore();
|
|
|
|
await Assert.ThrowsAsync<ArgumentNullException>(() => store.SaveAsync(null!));
|
|
}
|
|
}
|