private static DummyResponseFeature GetResponse()
        {
            var feature = new DummyResponseFeature
            {
                Headers = new HeaderDictionary()
            };

            return(feature);
        }
        private static (HttpContext, RequestDelegate) GetOnStartingResponseAwareContext()
        {
            DummyResponseFeature feature = GetResponse();

            var context = new DefaultHttpContext();

            context.Features.Set <IHttpResponseFeature>(feature);

            async Task next(HttpContext ctx)
            {
                await feature.InvokeCallBack();
            }

            return(context, (RequestDelegate)next);
        }