public Sheet CreateSheetObject()
        {
            Column colA = new Column.AddColumnBuilder("Favorite", null, ColumnType.CHECKBOX).SetSymbol(Symbol.STAR).Build();
            Column colB = new Column.AddColumnBuilder("Primary Column", null, ColumnType.TEXT_NUMBER).Build();
            Column colC = new Column.AddColumnBuilder("Col 3", null, ColumnType.PICKLIST).SetOptions(new List <string> {
                "Not Started", "Started", "Completed"
            }).Build();
            Column colD = new Column.AddColumnBuilder("Date", null, ColumnType.DATE).Build();

            colB.Primary = true;
            Sheet sheet = new Sheet.CreateSheetBuilder("CSharp SDK Test", new List <Column> {
                colA, colB, colC, colD
            }).Build();

            return(sheet);
        }
Beispiel #2
0
        public virtual void TestAddColumn()
        {
            server.setResponseBody("../../../TestSDK/resources/addColumn.json");
            Column col1 = new Column.AddColumnBuilder("New Picklist Column 1", 4, ColumnType.PICKLIST).Build();
            Column col2 = new Column.AddColumnBuilder("New Picklist Column 1", 1, ColumnType.PICKLIST).Build();

            col1.Options = new List <string> {
                "First", "Second", "Third"
            };

            IList <Column> newCols = sheetColumnResourcesImpl.AddColumns(1234L, new List <Column> {
                col1, col2
            });

            Assert.AreEqual(150, newCols[0].Width);
            Assert.IsTrue(newCols[0].Type == ColumnType.PICKLIST);
            Assert.IsTrue(newCols[0].Index == 4);
            Assert.IsTrue(newCols[2].Id == 6755394238748795);
            Assert.IsTrue(newCols[2].Title == "New Picklist Column 2");
            Assert.IsTrue(newCols[2].Options[1] == "2");
        }