Showing posts with label asp.net-mvc. Show all posts
Showing posts with label asp.net-mvc. Show all posts

Wednesday, September 15, 2010

Testing ASP.NET MVC Filters

Testing controllers in ASP.NET MVC is straight forward.  However, testing action filters applied to controllers or actions requires jumping through a few hoops.  Since filters are applied by the framework, calling the action directly means no filters are executed.  Thus, you write two tests: one for the filter and one that the controller is decorated with the filter.