public void AuthorizeAdminWithQueryAttributes_AsAnonymousWithQueries()
        {
            var context = generateContext();

            context.HttpContext.Request.QueryString = context.HttpContext.Request.QueryString.Add("LoanDuration", "20");

            var admin = new AdminWithQueryAttributes();

            Assert.Throws <AuthorizationException>(() => admin.OnActionExecuting(context));
        }
        public void AuthorizeAdminWithQueryAttributes_AsAdminWithQueries()
        {
            var context = generateContext();

            context.HttpContext.Request.Headers["Authorization"] = "admin";
            context.HttpContext.Request.QueryString = context.HttpContext.Request.QueryString.Add("LoanDuration", "20");

            var admin = new AdminWithQueryAttributes();

            admin.OnActionExecuting(context);
        }
 public void AuthorizeAdminWithQueryAttributes_AsAnonymousNoQueries()
 {
     var context = generateContext();
     var admin   = new AdminWithQueryAttributes();
 }