public void shouldHaveAuthorizeAttributeOnAllActions()
{
var controllerTypes = getControllerTypes(typeof(HomeController).Assembly);
var actionMethods = getActionMethods(controllerTypes);
foreach (var action in actionMethods) {
if (IsExcludedFromAuthorizeRule(action)) continue;
Assert.That(
HasAuthorizeAttribute(action),
"Action method " + action.DeclaringType.Name + "/" + action.Name + " doesn't have required AuthorizeAttribute"
);
}
}