public void CreateIfDoesNotExist(string name) { var originalDbName = _configurationService.GetConnectionConfigDbName(name); var masterDbConnectionConfig = _configurationService.GetMasterConnectionConfig(name); using (var dbConnection = new SqlConnection(masterDbConnectionConfig.ConnectionString)) { dbConnection.Open(); _dbProvider.Create(dbConnection, originalDbName); } }
public void Should_be_able_to_get_master_cfg() { var result = cfg.GetMasterConnectionConfig("db1"); Assert.That(result, Is.Not.Null); Assert.That(result.Name, Is.EqualTo("db1")); Assert.That(result.Provider, Is.Not.Null.Or.Empty); Assert.That(result.ConnectionString, Contains.Substring("master")); }