action-filters

Enforce Action Filter on all Controller Actions (C# / ASP.NET MVC)

Hello, I made a new action filter (attribute, similar to [Authorize]) which authorizes access to a controller action based on a session value. However, I'm basically decorating all my controller actions with that attribute (with the exception of very few). So, I thought it would be better to have that Action Filter always executed exc...

How to write test case for mvc action filters?

Hi, I have an action filter which i got from the below link http://blog.wekeroad.com/blog/aspnet-mvc-securing-your-controller-actions/ there is something called "RequiresAuthenticationAttribute" for this i need to write test case. how can i do this? form some of the blogs i read that we need to mock httcontext. How can i mock this? wha...