コード例 #1
0
        public void DropDatabase()
        {
            IDbQueryBase dbQueryBase = this.BuildDbQueryBase();

            dbQueryBase.ExecuteNonQuery("USE [master]");
            dbQueryBase.ExecuteNonQuery($"DROP DATABASE {this.dbName}");
        }
コード例 #2
0
        public void CreateDatabase()
        {
            IDbQueryBase dbQueryBase = this.BuildDbQueryBase();
            string       fullSql     = File.ReadAllText(scriptFilePath).Replace("@DBNAME", this.dbName);

            foreach (string sql in fullSql.Split(";"))
            {
                dbQueryBase.ExecuteNonQuery(sql);
            }
        }
コード例 #3
0
        public BootstrapFixture()
        {
            IDbQueryBase dbQueryBase = this.BuildDbQueyBase();

            this.container = new DbAbstractionTestContainer(dbQueryBase);

            string fullSql = File.ReadAllText(scriptFilePaht).Replace("@DBNAME", dbName);

            foreach (string sql in fullSql.Split(";"))
            {
                dbQueryBase.ExecuteNonQuery(sql);
            }
        }