public void Verify_ActivityIndex_Method_Is_Decorated_With_Authorize_Attribute() { ActivityController controller = new ActivityController(_activityManager, _personManager, _utilityManager); var type = controller.GetType(); var methodInfo = type.GetMethod("ActivityIndex", new Type[] { typeof(string) }); var attributes = methodInfo.GetCustomAttributes(typeof(AuthorizeAttribute), true); Assert.IsTrue(attributes.Any(), "No AuthorizeAttribute found on ActivityIndex(string searchString) method"); }