How to unit test of CodeFirst Membership Provider?

Jun 21, 2012 at 11:26 AM

It seems easy to implement the underlying membership management by design.

But I'm wondering how to unit test of it? Do we need the complicated Mock method, or there's easy alternatives?

I had tried to write some unit test code, but it turns out the basic Roles is not enabled, couldn't find the way out.

Can you please give me some guideline? Or there's already example?

Thanks for your greate work!

Jun 21, 2012 at 11:31 AM

Current implementation is tightly coupled, so its easy for beginners.

If you wish to use unit testing you will have to separate the logic into multiple tiers and implement Unit of Work and Repository patterns yourself.