public XmlStoreHiveTests() { using (DisposableTimer.TraceDuration <XmlStoreHiveTests>("Start setup", "End setup")) { // Create reader var xmlPath = Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase.Substring("file:\\\\".Length + 1)), "App_Data\\umbraco.config"); _fakeFrameworkContext = new FakeFrameworkContext(); _dataContextFactory = new DataContextFactory(xmlPath); _readOnlyUnitOfWorkFactory = new ReadOnlyUnitOfWorkFactory(); _directHiveReadProvider = new HiveReadProvider(new HiveProviderSetup(_fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), _readOnlyUnitOfWorkFactory, null, _dataContextFactory)); // Create writer _readWriteUnitOfWorkFactory = new ReadWriteUnitOfWorkFactory(); _writeProvider = new HiveReadWriteProvider(new HiveProviderSetup(_fakeFrameworkContext, "rw-unit-tester", new FakeHiveProviderBootstrapper(), null, _readWriteUnitOfWorkFactory, _dataContextFactory)); // Create hive wrappers for the readers and writers var governorRUowFactory = new ReadOnlyUnitOfWorkFactoryWrapper(new[] { _directHiveReadProvider }); var governorRWUowFactory = new ReadWriteUnitOfWorkFactoryWrapper(new[] { _writeProvider }); _hiveReadProviderViaGovernor = new Framework.Hive.PersistenceGovernor.HiveReadProvider(new HiveProviderSetup(_fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), governorRUowFactory, null, null), new[] { _directHiveReadProvider }); _hiveReadWriteProviderViaGovernor = new Framework.Hive.PersistenceGovernor.HiveReadWriteProvider(new HiveProviderSetup(_fakeFrameworkContext, "rw-unit-tester", new FakeHiveProviderBootstrapper(), null, governorRWUowFactory, null), new[] { _writeProvider }); } }
public XmlStoreHiveTests() { using (DisposableTimer.TraceDuration<XmlStoreHiveTests>("Start setup", "End setup")) { // Create reader var xmlPath = Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase.Substring("file:\\\\".Length + 1)), "App_Data\\umbraco.config"); _fakeFrameworkContext = new FakeFrameworkContext(); _dataContextFactory = new DataContextFactory(xmlPath); _readOnlyUnitOfWorkFactory = new ReadOnlyUnitOfWorkFactory(); _directHiveReadProvider = new HiveReadProvider(new HiveProviderSetup(_fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), _readOnlyUnitOfWorkFactory, null, _dataContextFactory)); // Create writer _readWriteUnitOfWorkFactory = new ReadWriteUnitOfWorkFactory(); _writeProvider = new HiveReadWriteProvider(new HiveProviderSetup(_fakeFrameworkContext, "rw-unit-tester", new FakeHiveProviderBootstrapper(), null, _readWriteUnitOfWorkFactory, _dataContextFactory)); // Create hive wrappers for the readers and writers var governorRUowFactory = new ReadOnlyUnitOfWorkFactoryWrapper(new[] { _directHiveReadProvider }); var governorRWUowFactory = new ReadWriteUnitOfWorkFactoryWrapper(new[] { _writeProvider }); _hiveReadProviderViaGovernor = new Framework.Hive.PersistenceGovernor.HiveReadProvider(new HiveProviderSetup(_fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), governorRUowFactory, null, null), new[] { _directHiveReadProvider }); _hiveReadWriteProviderViaGovernor = new Framework.Hive.PersistenceGovernor.HiveReadWriteProvider(new HiveProviderSetup(_fakeFrameworkContext, "rw-unit-tester", new FakeHiveProviderBootstrapper(), null, governorRWUowFactory, null), new[] { _writeProvider }); } }