asp.net mvc - Testing an MVC Controller action with an ActionFilterAttribute -


A well known advantage of MVC is its suitability for test-driven development (TDD) because you can call directly from your controller functions. Your test methods

Did you return a ActionFilter attribute (using OnActionExecuted by ActionResult )? If I just call action, this action returns ActionResult , but the filter feature is never implemented, I think you can get it by the controller. Action Inkker Invoke Action (Controller Consort, "ActionName") , but you have to suffer the Controller Contex to do this work so that it is a real pain. / P>

Has anyone done this successfully?

The unit test is not about the combination of single units

of them Regarding the test methodology / procedure / testing of a unit of work, you should examine the properties for different controller action.

  1. You should first check that your controller action is working as expected and returning the expected action result.

Two separate unit tests, not one.

strong>


Comments