public void ImageGetAttachmentInfoReturnsInvalidPasswordTest()
        {
            var file = TestFiles.WithAttachmentMsg;

            var request = new ImageGetAttachmentInfoRequest
            {
                FileName           = file.FileName,
                AttachmentName     = file.AttachmentName,
                Password           = null,
                AttachmentPassword = "******",
                Folder             = file.Folder,
                Storage            = null,
            };

            var ex = Assert.Throws <ApiException>(() =>
            {
                ViewerApi.ImageGetAttachmentInfo(request);
            });

            Assert.AreEqual("Password provided for file with name 'password-protected.docx' is incorrect.", ex.Message);
        }
        public void ImageGetAttachmentInfoReturnsAttachmentNotFoundTest()
        {
            var file = TestFiles.WithAttachmentMsg;

            var request = new ImageGetAttachmentInfoRequest
            {
                FileName           = file.FileName,
                AttachmentName     = "not-found.pdf",
                Password           = null,
                AttachmentPassword = null,
                Folder             = file.Folder,
                Storage            = null,
            };

            var ex = Assert.Throws <ApiException>(() =>
            {
                ViewerApi.ImageGetAttachmentInfo(request);
            });

            Assert.AreEqual("Can't find attachment with given name 'not-found.pdf'.", ex.Message);
        }
        public void ImageGetAttachmentInfoReturnsPasswordNotProvidedTest()
        {
            var file = TestFiles.WithAttachmentMsg;

            var request = new ImageGetAttachmentInfoRequest
            {
                FileName           = file.FileName,
                AttachmentName     = file.AttachmentName,
                Password           = null,
                AttachmentPassword = null,
                Folder             = file.Folder,
                Storage            = null,
            };

            var ex = Assert.Throws <ApiException>(() =>
            {
                ViewerApi.ImageGetAttachmentInfo(request);
            });

            Assert.AreEqual("The password was not provided. The specified file 'password-protected.docx' is password-protected.", ex.Message);
        }
        public void ImageGetAttachmentInfoTest()
        {
            var file = TestFiles.WithAttachmentMsg;

            var request = new ImageGetAttachmentInfoRequest
            {
                FileName           = file.FileName,
                AttachmentName     = file.AttachmentName,
                ExtractText        = null,
                Password           = null,
                AttachmentPassword = file.AttachmentPassword,
                Folder             = file.Folder,
                Storage            = null
            };

            var response = ViewerApi.ImageGetAttachmentInfo(request);

            Assert.AreEqual(1, response.Pages.Count);
            Assert.AreEqual(".docx", response.Extension);
            Assert.AreEqual("password-protected.docx", response.FileName);
        }