I have created a custom action filter (attribute) that hits a database. How can I unit test the controller actions by injecting a mock repository (so that it doesn't actually hit the database for the unit test) for the action filter to use?
A:
I had the same question a couple of weeks ago.
http://stackoverflow.com/questions/609942/unittest-actionfilter
At the end I accepted that I have to test the controller without the filter and test the filter itself.
Malcolm Frexner
2009-07-16 11:49:43
Thanks for the info but it does not explain how the action filter can work with a mock repository that I can inject from the unit test.
2009-07-18 01:47:35