protected override void SharedContext() { mockUoW = new MockUnitOfWork(); mockUoWFactory = new MockUoWFactory(mockUoW); IRepositoryFactory repositoryFactory = new StructureMapRepositoryFactory(); uowStorage = new ThreadStaticUnitOfWorkStorage(); UnitOfWork.Configure(new UnitOfWorkConfigurationBase(mockUoWFactory, repositoryFactory, uowStorage)); }
protected override void Context() { base.Context(); try { mockUoW = new MockUnitOfWork(); mockUoWFactory = new MockUoWFactory(mockUoW); IRepositoryFactory repositoryFactory = new StructureMapRepositoryFactory(); IUnitOfWorkStorage uowStorage = new ThreadStaticUnitOfWorkStorage(); UnitOfWork.Configure(new UnitOfWorkConfigurationBase(mockUoWFactory, repositoryFactory, uowStorage)); UnitOfWork.Start(() => { Transaction.Begin(); Transaction.Commit(); }); } catch (Exception ex) { caughtException = ex; } }