Last post Apr 14, 2011 08:43 PM by duttavr
Feb 26, 2011 07:33 PM|duttavr|LINK
ASP.NET MVC sessions and books say ASP.NET MVC enables to do unit testing as logic would be in controller independent to HTTP Request. So that controller can be unit tested indivisually. I do not think so people write their bussiness logic in controllers
rather in seperate bussiness layer assembly. So there is no need to test controllers in bussiness perspective.
I do not think so we write web applications without a seperate Bussiness Layer. In this case Bussiness Layer also a clear seperation from UI. So
BL can also be tested very well using UNIT testing frameworks either in MVC or in webforms.
then why should we chose ASP.NET MVC over WebForms in terms of UNIT Testing. Could anyone please clarify me in this regard if I'm wrong?
Feb 26, 2011 07:51 PM|raduenuca|LINK
You can do UI logic unit testing not Business Logic testing.
You can test what happens when a user clicks a link (calling a controller's action) and even test the result (as you get an ActionResult). You can't do that easily in Web Forms
Feb 26, 2011 08:52 PM|duttavr|LINK
You can test what happens when a user clicks a link (calling a controller's action)
Think of it, once I receive data into Webforms event handler, Only i do is just fill DTO and pass it to Validation Layer. So I can even test UI input validations before calling BL functions.
But testing of UI style and all, I hope these also can not be tested using controllers. as controllers does not know about UI components in MVC. So I did not see any advantage in ASP.NET MVC in terms of UI testing perspective. Could you
please specify any real time example?
and even test the result (as you get an ActionResult). You can't do that easily in Web Forms
Could you please specify any real time example also for this?
Apr 14, 2011 08:43 PM|duttavr|LINK
I would appreciate if anyone could share some inputs on this please.