Exemplo n.º 1
0
        public void UnnamedSqlTest()
        {
            var source   = "sql id{#test<sql {Hello}>}";
            var hash     = HashUtil.Base64SHA256("sql{Hello}");
            var expected = TransformRuntimeProvider($@"{{
    var result = MacroProvider.test(Unnamed{hash}());
    if (result.IsSuccess)
    {{
        sb.Append(result.Value);
    }}
    else
    {{
        return result;
    }}
}}
");
            var text     = GetEmiterText(source, p => p.root().namedSql()[0].coreSql());

            Assert.True(text.IsSuccess);
            Assert.Equal(expected, text.Value);
        }