コード例 #1
0
        public void Ctor_WhenBackgroundIndexingIsMissing_DefaultsToOff()
        {
            var cnString = new ConnectionString(@"sisodb:provider=Sql2008||plain:data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;");

            var cnInfo = new Sql2008ConnectionInfo(cnString);

            Assert.AreEqual(BackgroundIndexing.Off, cnInfo.BackgroundIndexing);
        }
コード例 #2
0
        public void Ctor_WhenCnStringWithOnlyPlainPart_InstanceWithDefaultsIsCreated()
        {
            var cnString = new ConnectionString(@"data source=.;initial catalog=foo;integrated security=SSPI;");

            var cnInfo = new Sql2008ConnectionInfo(cnString);

            Assert.AreEqual(StorageProviders.Sql2008, cnInfo.ProviderType);
            Assert.AreEqual(BackgroundIndexing.Off, cnInfo.BackgroundIndexing);
        }
コード例 #3
0
        public void WhenExplicitlyPassingMarsFalse_ItBecomesTrue()
        {
            var cnInfo = new Sql2008ConnectionInfo(@"data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;MultipleActiveResultSets=False");

            Assert.AreEqual(StorageProviders.Sql2008, cnInfo.ProviderType);
            Assert.AreEqual(@"Data Source=.;Initial Catalog=;Integrated Security=True;MultipleActiveResultSets=True", cnInfo.ServerConnectionString);
            Assert.AreEqual(@"Data Source=.;Initial Catalog=SisoDbTests.Temp;Integrated Security=True;MultipleActiveResultSets=True", cnInfo.ClientConnectionString);
            Assert.AreEqual("SisoDbTests.Temp", cnInfo.DbName);
        }
コード例 #4
0
        public void Ctor_WhenCorrectConnectionString_PartsExtracted()
        {
            var cnString = new ConnectionString(@"sisodb:provider=Sql2008;backgroundindexing=Off||plain:data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;");

            var cnInfo = new Sql2008ConnectionInfo(cnString);

            Assert.AreEqual(StorageProviders.Sql2008, cnInfo.ProviderType);
            Assert.AreEqual(BackgroundIndexing.Off, cnInfo.BackgroundIndexing);
            Assert.AreEqual("SisoDbTests.Temp", cnInfo.DbName);
            Assert.AreEqual(@"Data Source=.;Initial Catalog=;Integrated Security=True", cnInfo.ServerConnectionString.PlainString);
            Assert.AreEqual(@"data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;", cnInfo.ClientConnectionString.PlainString);
        }
コード例 #5
0
        public WebRegistry()
        {
            var cnInfo = new Sql2008ConnectionInfo("FluentSecurity.Sample");
            var instance = new Sql2008DbFactory().CreateDatabase(cnInfo);
            instance.CreateIfNotExists();

            For<ISisoDatabase>().Singleton().Use(instance);

            Scan(scan =>
            {
                scan.AssemblyContainingType<IDomainRepository>();
                scan.AssemblyContainingType<MvcApplication>();
                scan.WithDefaultConventions();
            });
        }
コード例 #6
0
		private static void EnsureDbExists()
		{
			var connectionInfo = new Sql2008ConnectionInfo(TestConstants.ConnectionStringNameForSql2008);
			var database = new Sql2008DbFactory().CreateDatabase(connectionInfo);
			database.EnsureNewDatabase();
		}