public void DoesNotThrowExceptionForNullResponse() { var httpContext = new Mock <HttpContextBase>(); httpContext.Setup(p => p.Response).Returns((HttpResponseBase)null); KissLogHttpModule module = new KissLogHttpModule(); module.OnPreRequestHandlerExecute(httpContext.Object); }
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)); }
public void ThrowsExceptionForNullHttpContext() { KissLogHttpModule module = new KissLogHttpModule(); module.OnPreRequestHandlerExecute(null); }