public void LoadsAllScriptsFromFile()
        {
            var collection = new SqlScriptCollection();

            collection.Add.FromFile(".\\Scripts\\SqlTest.sql");
            var sql = collection.GetScriptSql("SqlTest.sql");

            Assert.Equal(SqlLiteral, sql.Trim());
        }
        public async Task LoadsAllScriptsFromAssemblyAsync()
        {
            var collection = new SqlScriptCollection();
            await collection.Add.FromAssemblyAsync(assembly, "Dapper.Scripts.Tests.Scripts");

            var sql = collection.GetScriptSql("SqlTest.sql");

            Assert.Equal(SqlLiteral, sql.Trim());
        }
        public void LoadsAllScriptsFromAssemblyWithEncoding()
        {
            var collection = new SqlScriptCollection();

            collection.Add.FromAssembly(assembly, "Dapper.Scripts.Tests.Scripts", Encoding.UTF8);
            var sql = collection.GetScriptSql("SqlTest.sql");

            Assert.Equal(SqlLiteral, sql.Trim());
        }
Ejemplo n.º 4
0
        public void ScriptReplacesTags()
        {
            var collection = new SqlScriptCollection();

            collection.Add.FromDirectory(".\\Scripts");
            var sql = collection.GetScriptSql("SqlTransformTest.sql", _params);

            Assert.Equal(SqlLiteral, sql.Trim());
        }