Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Should UserAccountService implement an interface for testability? #21

Closed
tafs7 opened this issue Jan 31, 2013 · 1 comment
Closed

Should UserAccountService implement an interface for testability? #21

tafs7 opened this issue Jan 31, 2013 · 1 comment

Comments

@tafs7
Copy link

tafs7 commented Jan 31, 2013

I noticed that UserAccountService class is injected in sample controller, but should this class implement an interface, so that other classes (such as this controller) that depend on it could be unit tested, while mocking IUserAccountService?

@brockallen
Copy link
Owner

The methods should all be virtual, so you can just derive and override the ones you want for testing. Or you can mock the entire thing. Either way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants