outbox checkpoint

This commit is contained in:
2026-03-15 17:11:31 +01:00
parent f3a51dafad
commit a39453667a
63 changed files with 1410 additions and 55 deletions

View File

@@ -4,4 +4,23 @@ public abstract class BaseTest
{
protected const string UsersNamespace = "Mccn.Modules.Users";
protected const string HelloNamespace = "Mccn.Modules.Hello";
// Implementation namespaces checked for cross-module isolation.
// *.IntegrationEvents is excluded because it is a public contract assembly
// that other modules are explicitly allowed to reference.
protected static readonly string[] UsersImplementationNamespaces =
[
"Mccn.Modules.Users.Domain",
"Mccn.Modules.Users.Application",
"Mccn.Modules.Users.Infrastructure",
"Mccn.Modules.Users.Presentation"
];
protected static readonly string[] HelloImplementationNamespaces =
[
"Mccn.Modules.Hello.Domain",
"Mccn.Modules.Hello.Application",
"Mccn.Modules.Hello.Infrastructure",
"Mccn.Modules.Hello.Presentation"
];
}

View File

@@ -20,11 +20,16 @@ public class ModuleTests : BaseTest
typeof(DependencyInjection).Assembly
];
Types.InAssemblies(usersAssemblies)
.Should()
.NotHaveDependencyOn(HelloNamespace)
.GetResult()
.ShouldBeSuccessful();
// Check each Hello implementation namespace individually.
// Hello.IntegrationEvents would be an allowed reference (public contract), but Hello has none.
foreach (string ns in HelloImplementationNamespaces)
{
Types.InAssemblies(usersAssemblies)
.Should()
.NotHaveDependencyOn(ns)
.GetResult()
.ShouldBeSuccessful();
}
}
[Fact]
@@ -37,10 +42,16 @@ public class ModuleTests : BaseTest
typeof(Modules.Hello.Infrastructure.DependencyInjection).Assembly
];
Types.InAssemblies(helloAssemblies)
.Should()
.NotHaveDependencyOn(UsersNamespace)
.GetResult()
.ShouldBeSuccessful();
// Check each Users implementation namespace individually.
// Users.IntegrationEvents is explicitly excluded as it is a public contract
// that other modules are permitted to reference.
foreach (string ns in UsersImplementationNamespaces)
{
Types.InAssemblies(helloAssemblies)
.Should()
.NotHaveDependencyOn(ns)
.GetResult()
.ShouldBeSuccessful();
}
}
}