public sealed class AllExceptionHandler : IHttpModule { void IHttpModule.Init(HttpApplication context) { context.Error += new EventHandler(UncaughtException); } void IHttpModule.Dispose() { } private void UncaughtException(object sender, EventArgs e) { log.Error("Test Message"); } }
[TestMethod, CategorizeByConvention] public void WhenValidParameter_ShouldSetHandleUnCaughtException() { //Arrange var target = new AllExceptionHandler() as IHttpModule; var context = new Mock<HttpApplication>(MockBehavior.Strict); context.Raise(e => e.Error += null, new EventArgs()); //Assert }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)