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); }
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); }
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); }
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); }
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(); }); }
private static void EnsureDbExists() { var connectionInfo = new Sql2008ConnectionInfo(TestConstants.ConnectionStringNameForSql2008); var database = new Sql2008DbFactory().CreateDatabase(connectionInfo); database.EnsureNewDatabase(); }