Exemplo n.º 1
0
        public void WatchSmoke()
        {
            Directory.CreateDirectory("sqls");
            var tempFile = @"sqls\test.sdmap";
            File.WriteAllText(tempFile, "sql Hello{Hello}");
            SdmapExtensions.SetSqlDirectoryAndWatch(@".\sqls");

            try
            {
                File.WriteAllText(tempFile, "sql Hello{Hello2}");
                Thread.Sleep(30);
                var text = SdmapExtensions.EmitSql("Hello", null);
                Assert.Equal("Hello2", text);
            }
            finally
            {
                File.Delete(tempFile);
                Directory.Delete("sqls");
            }
        }
Exemplo n.º 2
0
 public void SqlEmiterTest()
 {
     SdmapExtensions.SetSqlEmiter(new SimpleSqlEmiter());
     var actual = SdmapExtensions.EmitSql("test", null);
     Assert.Equal("test", actual);
 }