Skip to content

Analyzer should suggest shared verification wrappers for provider-first count and any-args cases #147

Description

@cwinland

Docs reference: docs/getting-started/testing-guide.md

FastMoq now exposes shared verification wrappers for simple once/never/count assertions and for method-level any-args verification. Analyzer guidance should suggest those wrappers only when the verification semantics stay provider-first and unambiguous.

Scope

  • detect verification shapes that map cleanly to VerifyCalledOnce(...), VerifyNotCalled(...), VerifyCalledExactly(...), VerifyCalledAtLeast(...), VerifyCalledAtMost(...), and the matching VerifyAnyArgs(...) helpers
  • avoid suggestions when the original verification relies on call order, sequences, events, protected members, or other provider-bound behavior
  • keep overload-selection requirements explicit for any-args suggestions

Acceptance checklist

  • Analyzer diagnostics identify simple shared verification cases where the wrapper surface is clearer than the existing call.
  • Analyzer guidance avoids provider-bound verification cases that should stay outside #133's shared contract.
  • Any-args suggestions are offered only when the member selection is unambiguous or the analyzer can explain the explicit-parameter-types fallback.
  • Analyzer tests cover both positive wrapper suggestions and representative unsupported verification shapes.
  • The analyzer messages align with the supported/unsupported verification matrix documented for #133.

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzersAnalyzer and code-fix follow-up workenhancementNew feature or requestpriorityThis should be worked on before others

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions