public static void MyClassInitialize(TestContext testContext)
        {
            var frameworkContext =
                new FrameworkContext(
                    ConfigurationManager.GetSection("umbraco.foundation") as IFoundationConfigurationSection);

            var persistenceConfig = ConfigurationManager.GetSection("hive.persistence") as HiveConfigurationSection;

            var localConfig = persistenceConfig.AvailableProviders.ReadWriters["rw-nhibernate-01"].GetLocalProviderConfig() as ProviderConfigurationSection;

            var nhSetup = new NHibernateConfigBuilder("rw-nhibernate-01", localConfig);
            var config  = nhSetup.BuildConfiguration();

            // Setup the local provider
            var dataContextFactory = new DataContextFactory(config.BuildSessionFactory());
            var unitOfWorkFactory  = new ReadWriteRepositoryUnitOfWorkFactory(dataContextFactory);
            var reader             = new Reader(unitOfWorkFactory);
            var readWriter         = new ReadWriter(unitOfWorkFactory);

            var uriMatch = new DefaultUriMatch()
            {
                MatchType = UriMatchElement.MatchTypes.Wildcard, Uri = "content://*/"
            };

            // Setup hive's provider governor. Normally it takes two uow factories (read and read-write) but we can use the same for both here
            _mappingGroup = new DefaultPersistenceMappingGroup("rw-nhibernate-01", new[] { unitOfWorkFactory }, new[] { unitOfWorkFactory }, new[] { reader }, new[] { readWriter }, new[] { uriMatch });
        }
        public static void MyClassInitialize(TestContext testContext)
        {
            var frameworkContext =
                new FrameworkContext(
                    ConfigurationManager.GetSection("umbraco.foundation") as IFoundationConfigurationSection);

            var persistenceConfig = ConfigurationManager.GetSection("hive.persistence") as HiveConfigurationSection;

            var localConfig = persistenceConfig.AvailableProviders.ReadWriters["rw-nhibernate-01"].GetLocalProviderConfig() as ProviderConfigurationSection;

            var nhSetup = new NHibernateConfigBuilder("rw-nhibernate-01", localConfig);
            var config = nhSetup.BuildConfiguration();

            // Setup the local provider
            var dataContextFactory = new DataContextFactory(config.BuildSessionFactory());
            var unitOfWorkFactory = new ReadWriteRepositoryUnitOfWorkFactory(dataContextFactory);
            var reader = new Reader(unitOfWorkFactory);
            var readWriter = new ReadWriter(unitOfWorkFactory);

            var uriMatch = new DefaultUriMatch() {MatchType = UriMatchElement.MatchTypes.Wildcard, Uri = "content://*/"};

            // Setup hive's provider governor. Normally it takes two uow factories (read and read-write) but we can use the same for both here
            _mappingGroup = new DefaultPersistenceMappingGroup("rw-nhibernate-01", new[] { unitOfWorkFactory }, new[] { unitOfWorkFactory }, new[] { reader }, new[] { readWriter }, new[]{uriMatch});
        }