Ejemplo n.º 1
0
        public void JsonToHtml_EmptyContent()
        {
            jsonContent.Content = "";
            DocumentGeneratorController controller = new DocumentGeneratorController(documentGenerator, generatedDocumentLogger);

            Assert.ThrowsException <NsiArgumentNullException>(() => controller.GenerateHtmlFromJson(jsonContent));
        }
Ejemplo n.º 2
0
        public void Initialize()
        {
            _documentTypeRepositoryMock      = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock();
            _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock();
            jsonContent        = new GenerateDocumentRequest();
            htmlContent        = new GenerateDocumentRequest();
            htmlGenerator      = new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper());
            pdfGenerator       = new DocumentGenerator.Implementations.PdfGenerator();
            _docxGeneratorMock = DocxGeneratorMock.GetDocxGeneratorMock();
            _odtGeneratorMock  = OdtGeneratorMock.GetOdtGeneratorMock();

            generatedDocumentLogger = new DocumentGenerator.Implementations.Helpers.GeneratedDocumentLogger(_generatedDocumentRepositoryMock.Object);
            templateGenerator       = new TemplateGenerator(new DocumentGenerator.Implementations.PdfGenerator(), new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper()));
            documentGenerator       = new DocumentGenerator.Implementations.Generators.DocumentGenerator(_documentTypeRepositoryMock.Object, generatedDocumentLogger, htmlGenerator, pdfGenerator, _odtGeneratorMock.Object, _docxGeneratorMock.Object, templateGenerator);
            setJsonContent();
            setHtmlContent();
            controller = new DocumentGeneratorController(documentGenerator, generatedDocumentLogger);
        }