Пример #1
0
 public void Initialize()
 {
     try
     {
         _runner.Initialize();
     }
     catch (Exception ex)
     {
         _runtime.ReportInitializationError(ex);
         throw;
     }
 }
Пример #2
0
        public void Initialize_ReportsHandlerInitializationErrors_AndRethrowsException()
        {
            // arrange
            A.CallTo(() => _runner.Initialize()).Throws <DivideByZeroException>();

            // act
            var ex = Record.Exception(() => _bootstrap.Initialize());

            // assert
            ex.ShouldNotBeNull();
            ex.ShouldBeOfType <DivideByZeroException>();

            A.CallTo(() => _runtime.ReportInitializationError(A <DivideByZeroException> .Ignored))
            .MustHaveHappened();
        }