public void Context() { HttpContext.Current = FakeHttpContextHelper.GetFakeHttpContext(); var domainEventHandlerFactory = new FakeDomainEventHandlerFactory(domainEvent => _raisedDomainEvent = (TestDomainEvent)domainEvent); DomainEvents.Initialize(domainEventHandlerFactory); _volatileResourceManager = new VolatileResourceManager(); var unitOfWorkFactory = IoC.Resolve <IUnitOfWorkFactory>(); TransactionScopeUnitOfWorkHttpModule.Initialize( unitOfWorkFactory: unitOfWorkFactory, transactionScopeEnlistmentAction: transactionScope => _volatileResourceManager.EnlistIntoTransactionScope(transactionScope) ); var transactionScopeUnitOfWorkHttpModule = new TransactionScopeUnitOfWorkHttpModule(); var httpApplication = new FakeHttpApplication(); transactionScopeUnitOfWorkHttpModule.Init(httpApplication); httpApplication.FireBeginRequest(); _simulateApplicationTransaction(); httpApplication.FireEndRequest(); }
public void Context() { HttpContext.Current = FakeHttpContextHelper.GetFakeHttpContext(); var domainEventHandlerFactory = new FakeDomainEventHandlerFactory(domainEvent => _raisedDomainEvent = (TestDomainEvent)domainEvent); DomainEvents.Initialize(domainEventHandlerFactory, isDelayedDomainEventHandlingEnabled: true); DomainEvents.ResetDelayedEventsStorage(); var unitOfWorkFactory = IoC.Resolve <IUnitOfWorkFactory>(); UnitOfWorkHttpModule.Initialize(unitOfWorkFactory); var unitOfWorkHttpModule = new UnitOfWorkHttpModule(); var httpApplication = new FakeHttpApplication(); unitOfWorkHttpModule.Init(httpApplication); httpApplication.FireBeginRequest(); _simulateApplicationTransaction(); httpApplication.FireEndRequest(); }