Beispiel #1
0
        public void TestUpdateTableCellFormat()
        {
            string remoteFileName = "TestUpdateTableCellFormat.docx";

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

            var request = new UpdateTableCellFormatRequest(
                name: remoteFileName,
                tableRowPath: "sections/0/tables/2/rows/0",
                index: 0,
                format: new TableCellFormat()
            {
                BottomPadding   = 5.0f,
                FitText         = true,
                HorizontalMerge = TableCellFormat.HorizontalMergeEnum.First,
                WrapText        = true
            },
                folder: remoteDataFolder
                );
            var actual = this.WordsApi.UpdateTableCellFormat(request);

            Assert.NotNull(actual.CellFormat);
            Assert.AreEqual(5.0f, actual.CellFormat.BottomPadding);
            Assert.AreEqual(true, actual.CellFormat.FitText);
            Assert.AreEqual(true, actual.CellFormat.WrapText);
        }
        public void TestUpdateTableCellFormat()
        {
            var localName  = "TablesGet.docx";
            var remoteName = "TestUpdateTableCellFormat.docx";
            var fullName   = Path.Combine(this.dataFolder, remoteName);
            var cellFormat = new TableCellFormat {
                BottomPadding = 5, FitText = true, HorizontalMerge = TableCellFormat.HorizontalMergeEnum.First, WrapText = true
            };

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

            var request = new UpdateTableCellFormatRequest(remoteName, "sections/0/tables/2/rows/0", 0, this.dataFolder, format: cellFormat);
            var actual  = this.WordsApi.UpdateTableCellFormat(request);

            Assert.AreEqual(200, actual.Code);
        }