コード例 #1
0
 public void should_render_razor_template()
 {
     var fileStore = new FileStore();
     var renderService = new PresentationService(_batches, _templates, new LatexEngine(), new RazorEngine(), fileStore);
     try
     {
         var fileId = renderService.RenderLatex(TemplateId, BatchId);
         File.ReadAllText(fileStore.GetPath(fileId)).ShouldEqual(@"\documentclass[12pt]{article}
     \begin{document}
       Hello yada.
     \end{document}");
     }
     catch (PresentationService.RenderException exception)
     {
         Debug.WriteLine(exception.Details);
         throw;
     }
 }
コード例 #2
0
 public void should_throw_render_exception_when_razor_template_malformed()
 {
     var renderService = new PresentationService(_batches, _templates, new LatexEngine(), new RazorEngine(), new FileStore());
     Assert.Throws<PresentationService.RenderException>(() => renderService.RenderLatex(BadFormatRazorTemplateId, BatchId));
 }