BenMorris / NetArchTest

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

Add GetTypeNames variant of getting the Types for ConditionList and PredicateList #142

Closed thojaw closed 1 month ago

thojaw commented 2 months ago

When working with externally loaded Assemblies, using GetTypes() on ConditionList or PredicateList will fail, because the Types won't be loaded into the current App domain. To be able to safely work with the intermediate results as you'd normally do with GetTypes() (e.g. to be able to extract lists for further usage in e. g. HaveDependencyOn()) the Method GetTypeNames() which is currently only available on TestResult level, does come very handy.

Implemented GetTypeNames() on ConditionList or PredicateList.

As for testing, I only implemented a sample "any" test for a random condition.