Inheritance: IUnitOfWorkFactory
Ejemplo n.º 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));
        }
Ejemplo n.º 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;
            }
        }