예제 #1
0
        /// <summary>
        /// IHttpHandler implementation.
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            ResponseWrapper wrapper = new ResponseWrapper(new HttpResponseWrapper(context.Response));

            WriteResponse(context.Request.Url.LocalPath,
                            context.Request.ApplicationPath,
                            context.Request.Headers["If-Modified-Since"],
                            wrapper, context);
        }
예제 #2
0
        public void BinaryWrite_Should_Add_Content_Type()
        {
            // Arrange
            Mock<HttpResponseBase> responseMock = new Mock<HttpResponseBase>();
            responseMock.SetupAllProperties();

            HttpResponseBase response = responseMock.Object;
            ResponseWrapper wrapper = new ResponseWrapper(response);
            wrapper.ContentType = "image/jpeg";

            // Act
            wrapper.BinaryWrite(new byte[] { });

            // Assert
            Assert.That(response.ContentType, Is.EqualTo("image/jpeg"));
        }