I have an existing asp.net mvc application, where all the business logic was implemented inside controller. That is I fetch data from db to controller and write necessary business logic inside controller.
Now I am new in TDD, I know what is TDD but didn't yet implemented. So my question's are:
-
How should I use TDD approach for my application, someone suggested me to separate all business logic from controller to service layer. But I have lots of method inside controller. Should I separate all of those to methods inside service layer?
-
I read some articles there I got idea of repository pattern. Do i need to use repository pattern? or simply introduce service layer?
-
Suppose I have an action method "AddShippingAddress" what should be the probable test case, i mean some demo testing using TDD.
-
I need some good resource from where I can easily understand the TDD using existing mvc application as a beginner.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire