Beispiel #1
0
        /*======================= PUBLIC ========================================*/
        /************************ Events *****************************************/
        /************************ Properties *************************************/
        /************************ Construction ***********************************/
        /************************ Methods ****************************************/
        /*----------------------- CanForwardHttpResponseMessage -----------------*/
        /// <summary>
        /// Verifies the ExecuteResult of the result class
        /// </summary>
        //[TestMethod]
        public void CanForwardHttpResponseMessage()
        {
            var       msg         = Substitute.For <HttpResponseMessage>();
            var       fr          = new ForwardedResult(msg);
            var       httpContext = Substitute.ForPartsOf <HttpContext>();
            RouteData routeData   = new RouteData();
            var       context     = new ActionContext(httpContext, routeData, new ActionDescriptor());

            fr.ExecuteResult(context);
            // MUST FIX THIS UNIT TEST
            Assert.IsTrue(false);
        } /* End of Function - CanForwardHttpResponseMessage */
        } // end of function - AuthenticateAsync

        /*----------------------- CheckAuthorizationAsync -----------------------*/
        /// <summary>
        ///
        /// </summary>
        /// <param name="repo"></param>
        private async Task <ActionResult> CheckAuthorizationAsync(IRemoteRepository repo)
        {
            ActionResult retval = null;
            // Authenticate the repository
            var resp = await AuthenticateAsync(repo);

            // If we were not successful, then we will forward the result back to the
            // user
            if (System.Net.HttpStatusCode.OK != resp.StatusCode)
            {
                retval = new ForwardedResult(resp);
            }
            return(retval);
        } // end of function - CheckAuthorizationAsync