Exemplo n.º 1
0
        public void FetchDocumetnAsByteArray_WhenNullBase64String_ShouldReturnEmptyByteArray()
        {
            //---------------Arrange------------------
            var renderedDocumentOutput = new RenderedDocumentOutput();

            //---------------Act----------------------
            //---------------Assert-------------------
            Assert.Empty(renderedDocumentOutput.FetchDocumentAsByteArray());
        }
Exemplo n.º 2
0
        public void FetchDocumetnAsByteArray_WhenValidBase64String_ShouldReturnByteArray()
        {
            //---------------Arrange------------------
            var renderedDocumentOutput = new RenderedDocumentOutput
            {
                //---------------Act----------------------
                Base64String = "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
            };

            //---------------Assert-------------------
            Assert.NotEmpty(renderedDocumentOutput.FetchDocumentAsByteArray());
        }
 private void Respond_With_Pdf(RenderPdfInput inputTo,
                               IRespondWithSuccessOrError <IFileOutput, ErrorOutput> presenter,
                               RenderedDocumentOutput output)
 {
     presenter.Respond(new PdfFileOutput(inputTo.FileName, output.FetchDocumentAsByteArray()));
 }