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

Missing .CoReturn method #325

Open
tripleslash opened this issue Jan 10, 2024 · 1 comment
Open

Missing .CoReturn method #325

tripleslash opened this issue Jan 10, 2024 · 1 comment
Milestone

Comments

@tripleslash
Copy link

Hello, I want to co_return something from a mocked function. Something like:

// Instantiate a mock object.
Mock<SomeInterface> mock;

// Setup mock behavior.
When(Method(mock,foo)).CoReturn(1); // Method mock.foo will co_return 1 once.

But the CoReturn method does not exist. How can something like this be achieved?

@FranckRJ
Copy link
Collaborator

Maybe you can do it by using the .Do() method and passing it a lambda that uses co_return (if it's possible). But a proper support of coroutines in fakeit should be investigated.

@FranckRJ FranckRJ added this to the 2.5.0 milestone Jan 14, 2024
@FranckRJ FranckRJ modified the milestones: 2.5.0, 2.6.0 May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants