public override void FixtureSetUp(IBaseTestFixture fixture)
        {
            InMemoryConfigurationRegistry configurationRegistry = new InMemoryConfigurationRegistry();
            fixture.DisposeAtTheEndOfFixture(ConfigurationRegistry.Override(configurationRegistry));
            fixture.SetIntoTestContext(RegistryTestContextKey, configurationRegistry);

            base.FixtureSetUp(fixture);
        }
        /// <summary>
        /// In the test fixture setup I simply ovveride the configuration registry
        /// using an in memory configuration with a fixed connection string.
        /// </summary>
        protected override void OnTestFixtureSetUp()
        {
            sut = new NHibernateRepository<AnEntity>();
            sut.ConfigurationFileName = ConfigFileName;
            repo = new InMemoryConfigurationRegistry();
            repo.ConnStrings.Add(
                "main", new ConnectionStringSettings(
                    "main", "Data Source=DbFile1.db;Version=3", "System.Data.SQLite"));
            DisposeAtTheEndOfFixture(ConfigurationRegistry.Override(repo));
            NHibernateSessionManager.GenerateDbFor(ConfigFileName);

            base.OnTestFixtureSetUp();
        }
        public void TestFixtureSetUp()
        {
            overrideContext = new TestContext();
            OverrideContextCleanUp = CurrentContext.Override(overrideContext);
            repo = new InMemoryConfigurationRegistry();
            repo.ConnStrings.Add(
                "main", new ConnectionStringSettings(
                    "main", "Data Source=DbFile1.db;Version=3", "System.Data.SQLite"));
            repo.ConnStrings.Add(
                "NhConfig1", new ConnectionStringSettings(
                    "NhConfig1", "Data Source=:memory:;Version=3;New=True;", "System.Data.SQLite"));
            repo.ConnStrings.Add(
                "NhConfig2", new ConnectionStringSettings(
                    "NhConfig2", "Data Source=:memory:;Version=3;New=True;", "System.Data.SQLite"));

            OverrideSettings = ConfigurationRegistry.Override(repo);

            NHibernateSessionManager.GenerateDbFor("files//NhConfigFile1.cfg.xml");
        }
Пример #4
0
 public void TestFixtureSetUp()
 {
     repo = new InMemoryConfigurationRegistry();
     OverrideSettings = ConfigurationRegistry.Override(repo);
     InitDatabase();
 }