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

More convenient API for setting mocks #5

Open
ryanwersal opened this issue Dec 28, 2018 · 0 comments
Open

More convenient API for setting mocks #5

ryanwersal opened this issue Dec 28, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@ryanwersal
Copy link
Owner

Currently the pattern is:

var myMock = new Mock<IMyInterface>();
myMock.Setup(...).Etc();
Locator.CurrentMutable.RegisterConstant(myMock.Object, typeof(IMyInterface));

and it would be so much more convenient to remove the Splat calls and streamline getting these setup:

var myMock = autoMockContext.RegisterConstant<IMyInterface>();
myMock.Setup(...).Etc();

Additionally it might be ideal to use a callback to configure the mock?

var myMock = autoMockContext.RegisterConstant<IMyInterface>(mock =>
{
    mock.Setup(...).Etc();
});
@ryanwersal ryanwersal added the enhancement New feature or request label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant