public async void Generate_with_password_removal()
        {
            var file = TestConfig.PathToPasswordProtectedPdf;
            CreateImageFromPdfTask sut = new CreateImageFromPdfTask();
            sut.Decryptor = new PdfDecrypt() {Logger = new TestLogger()};
            sut.Passwords.Add("jarvistest");

            var convertParams = new CreatePdfImageTaskParams()
            {
                Dpi = 150,
                FromPage = 1,
                Pages = 1,
                Format = CreatePdfImageTaskParams.ImageFormat.Jpg,
            };
            Boolean wasCalled = false;
            var result = await sut.Run(
                file,
                convertParams,
                (i, s) =>
                {
                    wasCalled = true;
                    return Task.FromResult<Boolean>(true);
                }
            );

            Assert.IsTrue(wasCalled, "conversion failed.");

        }
        public async void Generate_smoke()
        {
            var file = TestConfig.PathToDocumentPdf;
            CreateImageFromPdfTask sut = new CreateImageFromPdfTask();

            var convertParams = new CreatePdfImageTaskParams()
            {
                Dpi = 150,
                FromPage = 1,
                Pages = 1,
                Format = CreatePdfImageTaskParams.ImageFormat.Jpg,
            };
            Boolean wasCalled = false;
            var result = await sut.Run(
                file,
                convertParams,
                (i, s) =>
                {
                    wasCalled = true;
                    return Task.FromResult<Boolean>(true);
                }
            );

            Assert.IsTrue(wasCalled, "conversion failed.");

        }
 private static void TestFile(
     List<PollerTestResult> retValue,
     CreateImageFromPdfTask task,
     String fileName,
     Byte[] fileContent)
 {
     var tempFile = Path.Combine(Path.GetTempPath(), fileName);
     if (File.Exists(tempFile)) File.Delete(tempFile);
     File.WriteAllBytes(tempFile, fileContent);
     try
     {
         var convertParams = new CreatePdfImageTaskParams()
         {
             Dpi = 150,
             FromPage = 1,
             Pages = 1,
             Format = CreatePdfImageTaskParams.ImageFormat.Jpg,
         };
         Boolean wasCalled = false;
         var result = task.Run(
             tempFile,
             convertParams,
             (i, s) =>
             {
                 wasCalled = true;
                 return Task.FromResult<Boolean>(true);
             }
         );
         result.Wait();
         if (wasCalled)
         {
             retValue.Add(new PollerTestResult(true, "Pdf to Jpg"));
         }
         else
         {
             retValue.Add(new PollerTestResult(false, "Pdf to Jpg"));
         }
     }
     catch (Exception ex)
     {
         retValue.Add(new PollerTestResult(false, "Pdf to Jpg: " + ex.Message));
     }
 }