public static ActionExecutingContext Create(DnControladorBase controller)
        {
            var actionContext = MockActionContextFactory.Create();

            return(new ActionExecutingContext(
                       actionContext,
                       filters: new List <IFilterMetadata>(),
                       actionArguments: new Dictionary <string, object>(),
                       controller: controller));
        }
        public static ActionExecutedContext Create(DnControladorBase controller)
        {
            var actionContext = new ActionContext(
                new DefaultHttpContext(),
                new RouteData(),
                new ActionDescriptor());

            var context = new ActionExecutingContext(
                actionContext,
                filters: new List <IFilterMetadata>(),
                actionArguments: new Dictionary <string, object>(),
                controller: controller);

            return(new ActionExecutedContext(actionContext, new List <IFilterMetadata>(), controller));
        }
Ejemplo n.º 3
0
        public static ExceptionContext GetMockExceptionContext <TC>(Exception exception, DnControladorBase controller)
        {
            var context = MockHttpControllerContextFactory.Create();

            return(new ExceptionContext(context, new List <IFilterMetadata>())
            {
                Exception = exception
            });
        }