public CachingFilterTests() { A.CallTo(() => httpContextAccessor.HttpContext) .Returns(httpContext); cachingManager = new CachingManager(httpContextAccessor, Options.Create(cachingOptions)); var actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor()); var actionFilters = new List <IFilterMetadata>(); executingContext = new ActionExecutingContext(actionContext, actionFilters, new Dictionary <string, object>(), this); executedContext = new ActionExecutedContext(actionContext, actionFilters, this) { Result = new OkResult() }; sut = new CachingFilter(cachingManager); }