BenMorris / NetArchTest

A fluent API for .Net that can enforce architectural rules in unit tests.
MIT License
1.36k stars 81 forks source link

Only check for sub namespace of a certain namespace and ignore the rest #106

Closed Velociraptor45 closed 1 year ago

Velociraptor45 commented 1 year ago

Hey there,

let's say I have a solution with dependencies like

How do I check if an assembly in that solution references the namespace MyNamespace.SubNamespace50 but not any of the others from MyNamespace? Now, I could use OnlyHaveDependenciesOn but then I'd have to list all the other dependencies apart from MyNamespace in there also (like System or Microsoft) - but I don't care about them. I only want to check for MyNamespace. NotHaveDependencyOn is also not an option because then I'd have to list all the gazillion sub namespaces. I couldn't find any Except method or something like that. Any idea on that?

NeVeSpl commented 1 year ago

You can only filter input types, that will be tested, there is no way to filter out dependencies (Except) in any way.

Velociraptor45 commented 1 year ago

Ah, damn. What a pity. Thanks for the answer.