Skip to content

Conversation

PatrickScottDS
Copy link

This is not a fully-realized API for sequence verification, but instead a minimal set of changes that exposes enough information to allow users to write their own sequence verification utilities that meet their specific needs. Existing user code can only inspect the mock.Invocations list for this purpose but with two major drawbacks: the order of invocations between separate mocks is unknown and filtering the list cumbersome without the expression matching functionality of mock.Setup(...) and mock.Verify(...).
These issues are addressed as follows:

  • Allow the total order of invocations to be compared between separate mocks by storing an atomically incremented global sequence number to each Invocation.
  • Return the list of matching Invocations from mock.Verify(...) (and all of its variations) as a convenient way of filtering the invocation list.
    • The returned list also includes the mock itself to allow for potential extension method chaining.

@CLAassistant
Copy link

CLAassistant commented Sep 4, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants