-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Consider the following assemblies, where each of them are having a marker interface:
Api(IApiMarker)Infrastructure(IInfrastructureMarker)Application(IApplicationMarker)Domain(IDomainMarker)SharedKernel(ISharedKernelMarker)
... and further the following references:
Apihas a reference toInfrastructureInfrastructurehas a reference toApplicationApplicationhas a reference toDomainandSharedKernelDomainhas a reference toSharedKernelSharedKerneldoesn't have any references
Now, I'd like to make sure, that these references stay in place and that dependencies only flow inwards (clean architecture).
I therefore created a test, let's call it ArchTest which references Api.
Now I'd like to ensure, that domain holds a reference to sharedkernel... (not sure if this test makes much sense...) But, why is the following test failing even so Domain has a reference to SharedKernel?
[Fact]
public void Domain_should_have_reference_to_shared_kernel()
{
var domain = typeof(IDomainMarker).Assembly;
var sharedKernel = typeof(ISharedKernelMarker).Assembly;
var result = Types.InAssembly(domain)
.Should()
.HaveDependencyOn(sharedKernel.GetName().Name)
.GetResult();
result.IsSuccessful.ShouldBeTrue();
}
P.S: Using NetArchTest.Rules v1.3.2
Metadata
Metadata
Assignees
Labels
No labels