public DatabaseActions(string connectionString) { connectionDetails = new SqlConnectionStringBuilder(connectionString); if (string.IsNullOrWhiteSpace(connectionDetails.InitialCatalog) || connectionDetails.IsMasterCatalog()) throw new ArgumentException("The connection must have an initial catalog set", "connectionString"); masterConnectionDetails = connectionDetails.ToMasterCatalog(); }
public void IsMasterCatalogFalse() { SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(@"server=(localdb)\MSSQLLocalDB;database=Test2;integrated security=True"); Assert.IsFalse(builder.IsMasterCatalog()); }