private static void MapRequestProperties(HttpRequestMessage request, IOwinContext context)
        {
            // Set the OWIN context on the request
            request.SetOwinContext(context);

            // Set the a request context on the request that lazily populates each property.
            HttpRequestContext requestContext = new OwinHttpRequestContext(context, request);

            request.SetRequestContext(requestContext);
        }
        public void RequestGet_ReturnsProvidedInstance()
        {
            // Arrange
            IOwinContext owinContext = CreateStubOwinContext();

            using (HttpRequestMessage expectedRequest = CreateRequest())
            {
                OwinHttpRequestContext context = CreateProductUnderTest(owinContext, expectedRequest);

                // Act
                HttpRequestMessage request = context.Request;

                // Assert
                Assert.Same(expectedRequest, request);
            }
        }
        private static void MapRequestProperties(HttpRequestMessage request, IOwinContext context)
        {
            // Set the OWIN context on the request
            request.SetOwinContext(context);

            // Set the a request context on the request that lazily populates each property.
            HttpRequestContext requestContext = new OwinHttpRequestContext(context, request);
            request.SetRequestContext(requestContext);
        }