public void CellsRangesPostWorksheetCellsRangesTest()
        {
            string           name         = "Book1.xlsx";
            string           sheetName    = "SHEET1";
            RangeCopyRequest rangeOperate = new RangeCopyRequest();

            //"copydata", new Range(10, 10.1, 1, 1, null, null, 2, 16.8), new Range(20, 10.1, 1, 1, null, null, 2, 16.8), new PasteOptions(true)
            rangeOperate.Operate      = "copydata";
            rangeOperate.PasteOptions = new PasteOptions();
            rangeOperate.PasteOptions.OnlyVisibleCells = true;
            Range range = new Range(); //10,10.1,1,1,null,null,2,16.8

            range.ColumnCount = 1;
            range.ColumnWidth = 10.1;
            range.FirstColumn = 1;
            range.FirstRow    = 1;
            range.RowCount    = 10;
            Range range2 = new Range(); //10,10.1,1,1,null,null,2,16.8

            range2.ColumnCount  = 1;
            range2.ColumnWidth  = 10.1;
            range2.FirstColumn  = 1;
            range2.FirstRow     = 20;
            range2.RowCount     = 10;
            rangeOperate.Source = range;
            rangeOperate.Target = range2;
            string folder = null;

            new Config().UpdateDataFile(folder, name);
            var response = instance.CellsRangesPostWorksheetCellsRanges(name, sheetName, rangeOperate, folder);

            Console.WriteLine(response);
        }
Пример #2
0
        public void CellsRangesPostWorksheetCellsRangesTest()
        {
            // TODO uncomment below to test the method and replace null with proper value
            string           name         = BOOK1;
            string           sheetName    = SHEET1;
            RangeCopyRequest rangeOperate = new RangeCopyRequest();

            //"copydata", new Range(10, 10.1, 1, 1, null, null, 2, 16.8), new Range(20, 10.1, 1, 1, null, null, 2, 16.8), new PasteOptions(true)
            rangeOperate.Operate      = "copydata";
            rangeOperate.PasteOptions = new PasteOptions();
            rangeOperate.PasteOptions.OnlyVisibleCells = true;
            Range range = new Range(); //10,10.1,1,1,null,null,2,16.8

            range.ColumnCount = 1;
            range.ColumnWidth = 10.1;
            range.FirstColumn = 1;
            range.FirstRow    = 1;
            range.RowCount    = 10;
            Range range2 = new Range(); //10,10.1,1,1,null,null,2,16.8

            range2.ColumnCount  = 1;
            range2.ColumnWidth  = 10.1;
            range2.FirstColumn  = 1;
            range2.FirstRow     = 20;
            range2.RowCount     = 10;
            rangeOperate.Source = range;
            rangeOperate.Target = range2;
            string folder = TEMPFOLDER;

            UpdateDataFile(folder, name);
            var response = instance.CellsRangesPostWorksheetCellsRanges(name, sheetName, rangeOperate, folder);

            Assert.IsInstanceOf <SaaSposeResponse>(response, "response is SaaSposeResponse");
            Assert.AreEqual(response.Code, 200);
        }