コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #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);
     }
 }