Skip to content

Get all method members calls? #136

@kristofferjalen

Description

@kristofferjalen

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)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions