コード例 #1
0
        public void ExceptionWithoutHandlerThrowsException()
        {
            var bootstrapper = new AutofacBootstrapper()
                               .WithContainer(new ExceptionThrowingContainerConfiguration());

            Assert.Throws <NotImplementedException>(() => bootstrapper.Build());
        }
コード例 #2
0
        public void ExceptionWithHandlerPassesLoggerFactory()
        {
            var bootstrapper = new AutofacBootstrapper()
                               .WithContainer(new ExceptionThrowingContainerConfiguration())
                               .WithExceptionHandler((exception, loggerFactory) =>
            {
                Assert.NotNull(loggerFactory);
                return(true);
            });

            bootstrapper.Build();
        }