0

I am new to mvc3 .Can anyone please tell me how to create unit test project ?my solution i am using dependency injection priniciple then how to test my methods.please give me any sample links to acheive that?

user3106578
  • 177
  • 1
  • 2
  • 12

1 Answers1

0

You can use Repository pattern (and Service layer) so that you can mock/stub all your database/service layer calls in your tests and inject the dependency. You can use it without the Service layer if you want but would suggest to go with it so that any business logic you have after getting data from DB using Repository can reside in that layer.

http://msdn.microsoft.com/en-us/magazine/dd942838.aspx#id0420033

Adarsh Shah
  • 6,755
  • 2
  • 25
  • 39