Пример #1
0
        public void DbSessionManagerAttribute_ShouldCloseSessionOnResultExcecuted()
        {
            var attribute = new DbSessionManagerAttribute();

            attribute.OnResultExecuted(new ResultExecutedContext());
            _dbSessionManager.AssertWasCalled(x => x.CloseSession());
        }
Пример #2
0
 public void ShouldCloseDbSessionAfterCallingEachAsyncSubscriber()
 {
     _subscriptionService
     .Stub(x => x.GetSubscriptions <TestingEvent>())
     .Return(new List <IEventSubscriber <TestingEvent> >
     {
         new AsyncSubscriber(),
         new AsyncSubscriber2()
     });
     _publisher.Publish(new TestingEvent());
     Thread.Sleep(2000);
     Console.WriteLine(_sharedStringBuilder.ToString());
     _dbSessionManager.AssertWasCalled(x => x.CloseSession(), x => x.Repeat.Twice());
 }
Пример #3
0
 public void ShouldOpenTransactionWhenDbTransactionAttributeIsApplied()
 {
     ExecuteArrangeAndAct(new CommandHandlerWithTransactionAttribute());
     _dbSessionManager.AssertWasCalled(x => x.OpenTransaction());
 }