Beispiel #1
0
        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));
        }
Beispiel #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;
            }
        }