Skip to content
New issue

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

Verification exception message does include configured setups for delegate mocks #677

Closed
stakx opened this issue Sep 4, 2018 · 0 comments · Fixed by #679
Closed

Verification exception message does include configured setups for delegate mocks #677

stakx opened this issue Sep 4, 2018 · 0 comments · Fixed by #679
Assignees
Labels
Milestone

Comments

@stakx
Copy link
Contributor

stakx commented Sep 4, 2018

With Moq v4.9.0, the following code:

var mock = new Mock<Action>();
mock.Setup(m => m());
mock.Verify(m => m(), Times.Once());

will throw the following exception:

Moq.MockException:
Expected invocation on the mock once, but was 0 times: m =>
No setups configured.
No invocations performed.
   at …

The statement No setups configured. is obviously incorrect, since there is a matching setup.

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

Successfully merging a pull request may close this issue.

1 participant