TNG / ArchUnitNET

A C# architecture test library to specify and assert architecture rules in C# for automated testing.
Apache License 2.0
933 stars 61 forks source link

Slice matching does not group classes of subnamespaces into the correct slice #208

Open MikeOnTea opened 1 year ago

MikeOnTea commented 1 year ago

Given these example dependencies:

Module.One.Class1 -> Module.Two.Class1
Module.Two.Class2 -> Module.One.Class1

a slice rule of Slices().Matching("Module.(*)").Should().BeFreeOfCycles() finds the dependency cycle. However, if you move Class2 into a sub-namespace, the cycle no longer gets detected:

Module.One.Class1 -> Module.Two.Class1
Module.Two.InnerNamespace.Class2 -> Module.One.Class1