Пример #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();
        }