public void DbSessionManagerAttribute_ShouldCloseSessionOnResultExcecuted() { var attribute = new DbSessionManagerAttribute(); attribute.OnResultExecuted(new ResultExecutedContext()); _dbSessionManager.AssertWasCalled(x => x.CloseSession()); }
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()); }
public void ShouldOpenTransactionWhenDbTransactionAttributeIsApplied() { ExecuteArrangeAndAct(new CommandHandlerWithTransactionAttribute()); _dbSessionManager.AssertWasCalled(x => x.OpenTransaction()); }