public void AutoFillSerial_Vertical()
        {
            // Arrange
            sheet[1, 1] = 1;
            sheet[2, 1] = 2;

            // Act
            sheet.AutoFillSerial(RangePosition.FromCellPosition(1, 1, 2, 1), RangePosition.FromCellPosition(3, 1, 4, 1));

            // Assert
            Assert.AreEqual(3, sheet[3, 1]);
            Assert.AreEqual(4, sheet[4, 1]);
        }
        public void AutoFillSerial_Horizontol()
        {
            // Arrange
            sheet[1, 1] = 1;
            sheet[1, 2] = 2;

            // Act
            sheet.AutoFillSerial(RangePosition.FromCellPosition(1, 1, 1, 2), RangePosition.FromCellPosition(1, 3, 1, 4));

            // Assert
            Assert.AreEqual(3, sheet[1, 3]);
            Assert.AreEqual(4, sheet[1, 4]);
        }
        public void AutoFillSerial_InputData_ExpectedOutputData(object[] inputData, object[] outputData)
        {
            // Arrange
            for (int r = 0; r < inputData.Length; r++)
            {
                sheet[r, 0] = inputData[r];
            }

            var outputRange = RangePosition.FromCellPosition(inputData.Length, 0, inputData.Length + outputData.Length - 1, 0);

            // Act
            sheet.AutoFillSerial(
                RangePosition.FromCellPosition(0, 0, inputData.Length - 1, 0),
                outputRange
                );

            // Assert
            Console.WriteLine("Values in input range:");
            inputData.ToList().ForEach(Console.WriteLine);
            Console.WriteLine("Expected output:");
            outputData.ToList().ForEach(Console.WriteLine);

            Console.WriteLine("Actual output:");
            sheet.IterateCells(outputRange, (r, c, cell) =>
            {
                Console.WriteLine(cell.Data);
                return(true);
            });

            var offset = inputData.Length;

            for (var r = 0; r < outputData.Length; r++)
            {
                Assert.AreEqual(outputData[r], sheet[r + offset, 0]);
            }
        }
Ejemplo n.º 4
0
 protected override RangePosition CreateRange(int i)
 {
     return(RangePosition.FromCellPosition(FTopRow[i], FLeftCol[i], FBottomRow[i], FRightCol[i]));
 }
Ejemplo n.º 5
0
 protected override RangePosition CreateRange(int i)
 {
     return(RangePosition.FromCellPosition(FRow[i], FCol[i], 1, 1));
 }