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

Reset invocation data without reset the whole mock object #118

Closed
FlashBurnGitHub opened this issue Nov 10, 2017 · 2 comments
Closed

Reset invocation data without reset the whole mock object #118

FlashBurnGitHub opened this issue Nov 10, 2017 · 2 comments

Comments

@FlashBurnGitHub
Copy link

If I created a mock object I can reset it with the Reset() function, but this is a complete reset.

What I would like to have is a reset of just the invocation data. So that I can do the following:

Mock<SomeInterface> mock;
When(Method(mock,foo)).AlwaysReturn(1);

SomeInterface & i = mock.get();

for(int x = 0; x < 10; x++)
{
    BarClass bar(&i, x);

    bar.foo(20);

    Verify(Method(mock,foo).Using(20));
    Verify(Method(mock,foo)).Once();
    Method(mock,foo).reset();
}

Or is something like that already possible?

@eranpeer
Copy link
Owner

eranpeer commented Nov 10, 2017 via email

@eranpeer
Copy link
Owner

I updated the quick start. It now mentions this option.

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

No branches or pull requests

2 participants