public ActionResult HandblebarPdf(HandlebarPdfRequestEntity model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var html   = HandlebarHelper.DataTemplateToHtml(model.HandlebarHtmlTemplate, model.JsonData);
                var entity = new HandlebarPdfEntity
                {
                    Header              = model.Header,
                    Html                = html,
                    FileSavePath        = model.FileSavePath,
                    UniqueReference     = model.UniqueReference,
                    AdditionalDocuments = model.AdditionalDocuments
                };

                var response = PdfCreationService.CreatePdf(entity);

                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex));
            }
        }
        public void HandblebarPdf_CallsPdfService()
        {
            _PdfCreationHelper.Setup(x => x.CreatePdf(It.IsAny <HandlebarPdfEntity>()))
            .Returns("test");

            var entity = new HandlebarPdfRequestEntity
            {
                FileSavePath          = "test",
                Header                = "test",
                UniqueReference       = "test",
                HandlebarHtmlTemplate = "test",
                JsonData              = "test"
            };

            _controller.HandblebarPdf(entity);

            _PdfCreationHelper.Verify(x => x.CreatePdf(It.IsAny <HandlebarPdfEntity>()), Times.Once);
        }