예제 #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_render_latex_pdf()
 {
     var fileStore = new FileStore();
     var renderService = new PresentationService(_batches, _templates, new LatexEngine(), new RazorEngine(), fileStore);
     Guid id;
     try
     {
         id = renderService.RenderPdf(TemplateId, BatchId);
     }
     catch (PresentationService.RenderException exception)
     {
         Debug.WriteLine(exception.Details);
         throw;
     }
     var path = fileStore.GetPath(id);
     Debug.WriteLine(path);
     File.Exists(path).ShouldBeTrue();
     new FileInfo(path).Length.ShouldNotEqual(0);
     Directory.Delete(Path.GetDirectoryName(path), true);
 }
예제 #3
0
 public void should_throw_render_exception_when_latex_malformed()
 {
     var renderService = new PresentationService(_batches, _templates, new LatexEngine(), new RazorEngine(), new FileStore());
     Assert.Throws<PresentationService.RenderException>(() => renderService.RenderPdf(BadLatexTemplateId, BatchId));
 }
예제 #4
0
 public void should_throw_render_exception_when_razor_binding_error()
 {
     var renderService = new PresentationService(_batches, _templates, new LatexEngine(), new RazorEngine(), new FileStore());
     Assert.Throws<PresentationService.RenderException>(() => renderService.RenderLatex(BadBindingRazorTemplateId, BatchId));
 }
예제 #5
0
 public PresentationPostHandler(PresentationService presentationService)
 {
     _presentationService = presentationService;
 }