public static StubIORepositoryReadWriter CreateRepositoryReadWriter(string supportedExtensions)
        {
            var frameworkContext = new FakeFrameworkContext();
            var hiveProvider     = new HiveReadWriteProvider(new HiveProviderSetup(frameworkContext, "rw-test-provider", null, null, null, null));

            var dir = new DirectoryInfo(TestHelper.AssemblyDirectory);
            //var dir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory;
            //dir = new DirectoryInfo(Path.Combine(dir.FullName, @"..\..\"));
            var dataContext = new DataContext(hiveProvider, supportedExtensions, dir.FullName, string.Empty, string.Empty);

            return(new StubIORepositoryReadWriter(dataContext));
        }
        public static StubIORepositoryReadWriter CreateRepositoryReadWriter(string supportedExtensions)
        {
            var frameworkContext = new FakeFrameworkContext();
            var hiveProvider = new HiveReadWriteProvider(new HiveProviderSetup(frameworkContext, "rw-test-provider", null, null, null, null));

            var dir = new DirectoryInfo(TestHelper.AssemblyDirectory);
            //var dir = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory;
            //dir = new DirectoryInfo(Path.Combine(dir.FullName, @"..\..\"));
            var dataContext = new DataContext(hiveProvider, supportedExtensions, dir.FullName, string.Empty, string.Empty);

            return new StubIORepositoryReadWriter(dataContext);
        }
        private static HiveReadWriteProvider CreateReadWritter()
        {
            var builder = new NHibernateConfigBuilder("data source=:memory:", "unit-tester",
                                                      SupportedNHDrivers.SqlLite, "thread_static", false);
            var config = builder.BuildConfiguration();
            var sessionFactory = config.BuildSessionFactory();
            _sessionForTest = sessionFactory.OpenSession();
            var schemaWriter = new StringWriter(new StringBuilder());
            new SchemaExport(config).Execute(false, true, false, _sessionForTest.Connection, schemaWriter);

            var fakeFrameworkContext = new FakeFrameworkContext();
            var dataContextFactory = new DataContextFactory(fakeFrameworkContext, _sessionForTest, true);

            var readWriteRepositoryUnitOfWorkFactory = new ReadWriteUnitOfWorkFactory();
            var writer = new HiveReadWriteProvider(new HiveProviderSetup(fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), null, readWriteRepositoryUnitOfWorkFactory, dataContextFactory));

            fakeFrameworkContext.TypeMappers.Add(
                new Lazy<AbstractTypeMapper, TypeMapperMetadata>(
                    () => new ManualMapper(new NhLookupHelper(dataContextFactory), writer), new TypeMapperMetadata(true)));
            
            return writer;
        }
        private static HiveReadWriteProvider CreateReadWritter()
        {
            var builder = new NHibernateConfigBuilder("data source=:memory:", "unit-tester",
                                                      SupportedNHDrivers.SqlLite, "thread_static", false);
            var config         = builder.BuildConfiguration();
            var sessionFactory = config.BuildSessionFactory();

            _sessionForTest = sessionFactory.OpenSession();
            var schemaWriter = new StringWriter(new StringBuilder());

            new SchemaExport(config).Execute(false, true, false, _sessionForTest.Connection, schemaWriter);

            var fakeFrameworkContext = new FakeFrameworkContext();
            var dataContextFactory   = new DataContextFactory(fakeFrameworkContext, _sessionForTest, true);

            var readWriteRepositoryUnitOfWorkFactory = new ReadWriteUnitOfWorkFactory();
            var writer = new HiveReadWriteProvider(new HiveProviderSetup(fakeFrameworkContext, "r-unit-tester", new FakeHiveProviderBootstrapper(), null, readWriteRepositoryUnitOfWorkFactory, dataContextFactory));

            fakeFrameworkContext.TypeMappers.Add(
                new Lazy <AbstractTypeMapper, TypeMapperMetadata>(
                    () => new ManualMapper(new NhLookupHelper(dataContextFactory), writer), new TypeMapperMetadata(true)));

            return(writer);
        }