public void TestGetDocumentWithFormat()
        {
            var localName  = "test_multi_pages.docx";
            var remoteName = "TestGetDocumentWithFormat.docx";
            var fullName   = Path.Combine(this.dataFolder, remoteName);
            var format     = "text";

            this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));

            var request = new GetDocumentWithFormatRequest(remoteName, format, this.dataFolder);
            var result  = this.WordsApi.GetDocumentWithFormat(request);

            Assert.IsTrue(result.Length > 0, "Conversion has failed");
        }
        public void TestGetDocumentWithFormat()
        {
            string remoteFileName = "TestGetDocumentWithFormat.docx";

            this.UploadFileToStorage(
                remoteDataFolder + "/" + remoteFileName,
                null,
                null,
                File.ReadAllBytes(LocalTestDataFolder + localFile)
                );

            var request = new GetDocumentWithFormatRequest(
                name: remoteFileName,
                format: "text",
                folder: remoteDataFolder
                );
            var actual = this.WordsApi.GetDocumentWithFormat(request);
        }
        public void TestGetDocumentWithFormatAndOutPath()
        {
            var localName    = "test_multi_pages.docx";
            var remoteName   = "TestGetDocumentWithFormatAndOutPath.docx";
            var fullName     = Path.Combine(this.dataFolder, remoteName);
            var format       = "text";
            var destFileName = Path.Combine(BaseTestOutPath, Path.GetFileNameWithoutExtension(remoteName) + ".text");

            this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));

            var request = new GetDocumentWithFormatRequest(remoteName, format, this.dataFolder, outPath: destFileName);

            this.WordsApi.GetDocumentWithFormat(request);
            var result = this.StorageApi.GetIsExist(destFileName, null, null);

            Assert.IsNotNull(result, "Cannot download document from storage");
            Assert.IsTrue(result.FileExist.IsExist, "File doesn't exist on storage");
        }
        public void TestGetDocumentFormatUsingStorage()
        {
            var localName  = "test_multi_pages.docx";
            var remoteName = "TestGetDocumentFormatUsingStorage.docx";
            var fullName   = Path.Combine(this.dataFolder, remoteName);
            var format     = "text";
            var storage    = "AWSStorageS3";

            // TODO to run this test please put your AppKey and AppSid for another storage
            // var anotherStorageApi = new StorageApi(StorageAppKey, StorageAppSID, BaseProductUri);
            // anotherStorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName));
            var anotherWordApi = new WordsApi(new Configuration {
                ApiBaseUrl = BaseProductUri, AppKey = this.AppKey, AppSid = this.AppSid
            });
            var request = new GetDocumentWithFormatRequest(remoteName, format, this.dataFolder, storage);
            var result  = anotherWordApi.GetDocumentWithFormat(request);

            Assert.IsTrue(result.Length > 0, "Conversion has failed");
        }