private string PresistFile(RenderCsvInput inputMessage, DisposableWorkSpace renderDirectory)
        {
            var reportPath = Path.Combine(renderDirectory.TmpPath, "report.xlsx");

            WriteTo(reportPath, inputMessage.Base64ExcelFile);
            return(reportPath);
        }
示例#2
0
        public void Ctor_WhenNoNameGiven_ShouldDefaultToReport()
        {
            //---------------Arrange-------------------
            //---------------Act----------------------
            var sut = new RenderCsvInput();
            //---------------Assert-----------------------
            var expected = "CsvFile";

            Assert.Equal(expected, sut.FileName);
        }
示例#3
0
        public void Ctor_WhenNameGiven_ShouldUseName()
        {
            //---------------Arrange-------------------
            //---------------Act----------------------
            var sut = new RenderCsvInput {
                FileName = "NewReport"
            };
            //---------------Assert-----------------------
            var expected = "NewReport";

            Assert.Equal(expected, sut.FileName);
        }
        public RenderedDocumentOutput ConvertToCsv(RenderCsvInput inputMessage)
        {
            using (var renderDirectory = GetWorkspace())
            {
                var pdfPresenter = new PropertyPresenter <string, ErrorOutput>();

                var reportPath = PresistFile(inputMessage, renderDirectory);

                CovertToCsv(reportPath, renderDirectory, pdfPresenter);

                return(RenderingErrors(pdfPresenter) ? ReturnErrors(pdfPresenter) : ReturnPdf(reportPath));
            }
        }