Пример #1
0
        public void Initialize()
        {
            _documentTypeRepositoryMock      = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock();
            _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock();
            jsonContent   = new GenerateDocumentRequest();
            htmlContent   = new GenerateDocumentRequest();
            nsiContext    = new NsiContext();
            htmlGenerator = new NSI.DocumentGenerator.Implementations.HtmlGenerator(new NSI.DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper());
            pdfGenerator  = new NSI.DocumentGenerator.Implementations.PdfGenerator();

            _docxGeneratorMock = DocxGeneratorMock.GetDocxGeneratorMock();
            _odtGeneratorMock  = OdtGeneratorMock.GetOdtGeneratorMock();

            generatedDocumentLogger = new NSI.DocumentGenerator.Implementations.Helpers.GeneratedDocumentLogger(_generatedDocumentRepositoryMock.Object);
            templateGenerator       = new TemplateGenerator(new NSI.DocumentGenerator.Implementations.PdfGenerator(), new NSI.DocumentGenerator.Implementations.HtmlGenerator(new NSI.DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper()));
            documentGenerator       = new NSI.DocumentGenerator.Implementations.Generators.DocumentGenerator(_documentTypeRepositoryMock.Object, generatedDocumentLogger, htmlGenerator, pdfGenerator, _odtGeneratorMock.Object, _docxGeneratorMock.Object, templateGenerator);
            jsonDocumentTypeDomain  = new DocumentTypeDomain()
            {
                Name     = "json",
                Code     = "json",
                Version  = "1.0",
                Encoding = "utf-8"
            };
            htmlDocumentTypeDomain = new DocumentTypeDomain()
            {
                Name     = "html",
                Code     = "html",
                Version  = "1.0",
                Encoding = "utf-8"
            };
        }
Пример #2
0
        public void Initialize()
        {
            _documentTypeRepositoryMock      = DocumentTypeRepositoryMock.GetDocumentTypeRepositoryMock();
            _generatedDocumentRepositoryMock = GeneratedDocumentRepositoryMock.GetGeneratedDocumentRepositoryMock();
            _docxGeneratorMock      = DocxGeneratorMock.GetDocxGeneratorMock();
            _odtGeneratorMock       = OdtGeneratorMock.GetOdtGeneratorMock();
            jsonContent             = new GenerateDocumentRequest();
            htmlContent             = new GenerateDocumentRequest();
            htmlGenerator           = new DocumentGenerator.Implementations.HtmlGenerator(new DocumentGenerator.Implementations.Helpers.HtmlGeneratorHelper());
            pdfGenerator            = new DocumentGenerator.Implementations.PdfGenerator();
            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);

            _templateVersionRepositoryMock = TemplateVersionRepositoryMock.GetTemplateVersionRepositoryMock();
            _folderRepositoryMock          = FolderRepositoryMock.GetFolderRepositoryMock();
            _templateRepositoryMock        = TemplateRepositoryMock.GetTemplateRepositoryMock();

            templateVersionManipulation = new TemplateVersionManipulation(_templateVersionRepositoryMock.Object);
            folderManipulation          = new FolderManipulation(_folderRepositoryMock.Object);
            templateManipulation        = new TemplateManipulation(_templateRepositoryMock.Object, templateVersionManipulation, folderManipulation);

            templateVersionManipulation = new TemplateVersionManipulation(_templateVersionRepositoryMock.Object);
            exportTemplateManipulation  = new ExportTemplateManipulation(templateManipulation, templateVersionManipulation, documentGenerator);
            controller = new TemplateManagementController(folderManipulation, templateManipulation, templateVersionManipulation, exportTemplateManipulation);

            createTemplateRequest();
        }
Пример #3
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);
        }