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

Adds a helper method to simplify the verification of dependencies #273

Closed andreaslausen closed 1 month ago

andreaslausen commented 5 months ago

I created a method that really simpilifies the verification of dependencies at the assembly level. You just need to write var rule = Dependencies.Check(sourceAssembly, [targetAssembly1, targetAssembly2]), call rule.Check and you're done.

It would be awesome if this method would be integrated into ArchUnitNET.

thojaw commented 5 months ago

I like the idea, not sure though if such methods should be part of the core library, you could have many more and they could be part of your own Extensions. That would be different if you'd access some internal classes, for example. But hey, I'm just some random guy, not a maintainer :)

alexanderlinne commented 1 month ago

Hi @andreaslausen, thank you for your PR. I'd agree with @thojaw here, since this would add a function that just contains another fluent expression I do not think this would belong in the core library. Additionally there is #130 which, although we cannot provide an ETA for the feature, make it possible to write something along the lines of Assemblies().That().Are(sourceAssembly).Should().NotDependOnAnyAssembliesThat().Are([targetAssembly1, targetAssembly2]).Check(architecture)