public void Ctor_WhenBackgroundIndexingIsMissing_DefaultsToOff()
        {
            var cnString = new ConnectionString(@"sisodb:provider=Sql2012||plain:data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;");

            var cnInfo = new Sql2012ConnectionInfo(cnString);

            Assert.AreEqual(BackgroundIndexing.Off, cnInfo.BackgroundIndexing);
        }
        public void WhenExplicitlyPassingMarsFalse_ItBecomesTrue()
        {
            var cnInfo = new Sql2012ConnectionInfo(@"data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;MultipleActiveResultSets=False");

            Assert.AreEqual(StorageProviders.Sql2012, 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_WhenCnStringWithOnlyPlainPart_InstanceWithDefaultsIsCreated()
        {
            var cnString = new ConnectionString(@"data source=.;initial catalog=foo;integrated security=SSPI;");

            var cnInfo = new Sql2012ConnectionInfo(cnString);

            Assert.AreEqual(StorageProviders.Sql2012, cnInfo.ProviderType);
            Assert.AreEqual(BackgroundIndexing.Off, cnInfo.BackgroundIndexing);
        }
        public void Ctor_WhenCorrectConnectionString_PartsExtracted()
        {
            var cnString = new ConnectionString(@"sisodb:provider=Sql2012;backgroundindexing=Off||plain:data source=.;initial catalog=SisoDbTests.Temp;integrated security=SSPI;");

			var cnInfo = new Sql2012ConnectionInfo(cnString);

            Assert.AreEqual(StorageProviders.Sql2012, 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 SisoDbTestCases()
 {
     var cnInfo = new Sql2012ConnectionInfo("SisoDb.Sql2012");
     _db = new Sql2012DbFactory().CreateDatabase(cnInfo);
     _db.EnsureNewDatabase();
 }