public void the_constructor_should_assign_failure_to_the_property()
        {
            var scope = Substitute.For<IContainerScope>();

            var sut = new ScopeClosingEventArgs(scope, false);

            sut.Successful.Should().BeFalse();
        }
        public void the_constructor_should_assign_scope_to_the_property()
        {
            var scope = Substitute.For<IContainerScope>();

            var sut = new ScopeClosingEventArgs(scope, true);

            sut.Scope.Should().BeSameAs(scope);
        }
Beispiel #3
0
 private void OnBackgroundJobScopeClosing(object sender, ScopeClosingEventArgs e)
 {
     try
     {
         e.Scope.Resolve <IAdoNetUnitOfWork>().SaveChanges();
     }
     catch (Exception exception)
     {
         Err.Report(e.Exception);
         _log.Error("Failed to close scope. Err: " + exception, e.Exception);
     }
 }