public void Should_rethrow_and_log_exceptions_from_job() { //Logger.EnsureInitialized(); //view sample error logging in output by uncommenting var agent = new ExceptionThrowingStubJob(); ExceptionThrowingFactoryStub.JobAgent = agent; var program = new Program(); program.GetFactoryTypeName = () => typeof(ExceptionThrowingFactoryStub).FullName + "," + GetType().Assembly.FullName; try { program.Run(new[] {"foo"}); Assert.Fail("Should not have reached here-Program should have thrown"); }catch { } }
public void Should_rethrow_and_log_exceptions_from_job() { //Logger.EnsureInitialized(); //view sample error logging in output by uncommenting var agent = new ExceptionThrowingStubJob(); ExceptionThrowingFactoryStub.JobAgent = agent; var program = new Program(); program.GetFactoryTypeName = () => typeof(ExceptionThrowingFactoryStub).FullName + "," + GetType().Assembly.FullName; try { program.Run(new[] { "foo" }); Assert.Fail("Should not have reached here-Program should have thrown"); }catch { } }
public ExceptionThrowingFactoryStub() { JobAgent = new ExceptionThrowingStubJob(_logger); }