We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to write a test asserting that no (non-test) code is used only for unit tests, just like this guy: https://stackoverflow.com/questions/73166287/check-entire-net-solution-to-verify-code-is-not-only-used-for-test
I can't find out how to get the calling types for a method. In ArchUnitTest there seems to be this:
MethodMembers() .That().AreCalledBy(Types().That().ResideInNamespace(".*(?i)Test.*", true) ) .Should().CallAny(MethodMembers().That().AreDeclaredIn(Types().That() .ResideInNamespace("^MyTypes.*", true) .And().DoNotResideInNamespace(".*(?i)Test.*", true)))
The text was updated successfully, but these errors were encountered:
NetArchTest does not have the equivalent of AreCalledBy, and it always operates on a type level.
NetArchTest
AreCalledBy
In NetArchTest.eNhancedEdition there is AreUsedByAny, thus it is possible to write smth like this:
NetArchTest.eNhancedEdition
AreUsedByAny
var result = Types.InAssembly(typeof(AppTests).Assembly, loadReferencedAssemblies: true) .That() .AreUsedByAny("AppTests") .And() .DoNotResideInNamespace("AppTests") .Should() .BeUsedByAny("App") .GetResult();
Sorry, something went wrong.
No branches or pull requests
I'm trying to write a test asserting that no (non-test) code is used only for unit tests, just like this guy: https://stackoverflow.com/questions/73166287/check-entire-net-solution-to-verify-code-is-not-only-used-for-test
I can't find out how to get the calling types for a method. In ArchUnitTest there seems to be this:
The text was updated successfully, but these errors were encountered: