You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. From what I can tell, it is not possible to later override the behavior of a Fake with when. I'm wondering if I could define a Fake/Mock class with default behavior, then override some of that only where necessary. For example, a repo that returns empty data unless overriden.
Hi. From what I can tell, it is not possible to later override the behavior of a Fake with when. I'm wondering if I could define a Fake/Mock class with default behavior, then override some of that only where necessary. For example, a repo that returns empty data unless overriden.
If you really want to do that then you can add the stubs in the mock class’s constructor body or create a helper function that constructs the mock instance and stubs the default methods.
How about add default stub when define the mock class?
Is this possible by any chance?
Work around
The text was updated successfully, but these errors were encountered: