示例#1
0
        public void DoesNotThrowExceptionForNullResponse()
        {
            var httpContext = new Mock <HttpContextBase>();

            httpContext.Setup(p => p.Response).Returns((HttpResponseBase)null);

            KissLogHttpModule module = new KissLogHttpModule();

            module.OnPreRequestHandlerExecute(httpContext.Object);
        }
示例#2
0
        public void UpdatesTheResponseFilterToMirrorStreamDecorator()
        {
            Stream ms           = new MemoryStream();
            var    httpResponse = new Mock <HttpResponseBase>();

            httpResponse.SetupProperty(p => p.Filter, ms);

            var httpContext = new Mock <HttpContextBase>();

            httpContext.Setup(p => p.Response).Returns(httpResponse.Object);

            KissLogHttpModule module = new KissLogHttpModule();

            module.OnPreRequestHandlerExecute(httpContext.Object);

            Assert.IsInstanceOfType(httpContext.Object.Response.Filter, typeof(MirrorStreamDecorator));
        }
示例#3
0
        public void ThrowsExceptionForNullHttpContext()
        {
            KissLogHttpModule module = new KissLogHttpModule();

            module.OnPreRequestHandlerExecute(null);
        }