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

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

            var response = ViewerApi.HtmlGetAttachmentInfo(request);

            Assert.AreEqual(1, response.Pages.Count);
            Assert.AreEqual(".docx", response.Extension);
            Assert.AreEqual("password-protected.docx", response.FileName);
        }
        public void HtmlGetAttachmentInfoReturnsInvalidPasswordTest()
        {
            var file = TestFiles.WithAttachmentMsg;

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

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

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

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

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

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

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

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

            Assert.AreEqual("Can't find attachment with given name 'not-found.pdf'.", ex.Message);
        }