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
add_X
remove_X
public interface IHaveMethodsNamedLikeEventAccessors { void add_Something(); void remove_Something(); } [Fact] // fails public void CanVerifyInvocationOfMethodNamedLikeEventAddAccessor() { var mock = new Mock<IHaveMethodsNamedLikeEventAccessors>(); mock.Object.add_Something(); mock.Verify(m => m.add_Something(), Times.Once); } [Fact] // fails public void CanVerifyInvocationOfMethodNamedLikeEventRemoveAccessor() { var mock = new Mock<IHaveMethodsNamedLikeEventAccessors>(); mock.Object.remove_Something(); mock.Verify(m => m.remove_Something(), Times.Once); }
Both verifications fail with Moq claiming that the methods were not called; for example:
Moq.MockException: Expected invocation on the mock once, but was 0 times: m => m.add_Something() Configured setups: m => m.add_Something() No invocations performed.
Moq.MockException: Expected invocation on the mock once, but was 0 times: m => m.add_Something()
Configured setups: m => m.add_Something() No invocations performed.
The text was updated successfully, but these errors were encountered:
stakx
No branches or pull requests
Both verifications fail with Moq claiming that the methods were not called; for example:
The text was updated successfully, but these errors were encountered: