コード例 #1
0
ファイル: BaseSpecs.cs プロジェクト: phiree/UnitOfWork
        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));
        }
コード例 #2
0
        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;
            }
        }