Exemple #1
0
 public void RenderTemplateSingleNoOutputPathTest()
 {
     try
     {
         var            codeGenerator = new CodeGenerator();
         ITemplateInput template      = new TemplateInputFileSource(SchemaFileName);
         var            database      = template.LoadSchema(Configuration.FromFile("ezdbcodegen.config.json"));
         codeGenerator.ProcessTemplate((@"{ASSEMBLY_PATH}Templates" + Path.DirectorySeparatorChar + @"SchemaRenderAsFiles.hbs").ResolvePathVars(), template);
         Assert.True(Directory.Exists(codeGenerator.OutputPath), string.Format("Template Rendered Output files in path {0} was not created", codeGenerator.OutputPath));
     }
     catch (Exception ex)
     {
         Assert.True(false, ex.Message);
     }
 }
Exemple #2
0
 public void RenderTemplateFileTest()
 {
     try
     {
         var            codeGenerator = new CodeGenerator();
         ITemplateInput template      = new TemplateInputFileSource(SchemaFileName);
         var            database      = template.LoadSchema(Configuration.FromFile("ezdbcodegen.config.json"));
         var            OutputPath    = System.IO.Path.GetTempPath() + "MySchemaNameRender.txt";
         if (File.Exists(OutputPath))
         {
             File.Delete(OutputPath);
         }
         codeGenerator.ProcessTemplate((@"{ASSEMBLY_PATH}Templates" + Path.DirectorySeparatorChar + @"SchemaRender.hbs").ResolvePathVars(), template, OutputPath);
         Assert.True(File.Exists(codeGenerator.OutputPath), string.Format("Template Rendered Output file {0} was not created.", codeGenerator.OutputPath));
     }
     catch (Exception ex)
     {
         Assert.True(false, ex.Message);
     }
 }
 public void ConfigDb()
 {
     ITemplateInput template = new TemplateInputFileSource(SchemaFileName);
     var            database = template.LoadSchema(Internal.AppSettings.Instance.Configuration);
 }