Example #1
0
        public ExcelFormatter(ExcelCellName leftTopCell, ExcelCellName rightTopCell, ExcelWorksheet worksheetParent)
        {
            IsDisposed = false;

            RightTopCell = rightTopCell;
            LeftTopCell = leftTopCell;
            WorksheetParent = worksheetParent;

            Range = worksheetParent.Worksheet.Range[leftTopCell.ToCellName(), rightTopCell.ToCellName()];
        }
        public void NegativeColumn_ReturnsEmpty()
        {
            const int    rowIndex    = 1;
            const int    columnIndex = -1;
            const string expected    = "";

            var result = ExcelCellName.CellNameFromIndex(rowIndex, columnIndex);

            result.Should().NotBeNull();
            result.Should().Be(expected);
        }
        public void TwentyEighthColumn_ReturnsAB13()
        {
            const int    rowIndex    = 12;
            const int    columnIndex = 27;
            const string expected    = "AB13";

            var result = ExcelCellName.CellNameFromIndex(rowIndex, columnIndex);

            result.Should().NotBeNull();
            result.Should().Be(expected);
        }
        public void TwentySeventhColumn_ReturnsAA2()
        {
            const int    rowIndex    = 1;
            const int    columnIndex = 26;
            const string expected    = "AA2";

            var result = ExcelCellName.CellNameFromIndex(rowIndex, columnIndex);

            result.Should().NotBeNull();
            result.Should().Be(expected);
        }
        public void SecondColumn_ReturnsB2()
        {
            const int    rowIndex    = 1;
            const int    columnIndex = 1;
            const string expected    = "B2";

            var result = ExcelCellName.CellNameFromIndex(rowIndex, columnIndex);

            result.Should().NotBeNull();
            result.Should().Be(expected);
        }
Example #6
0
 public ExcelFormatter GetFormatterAt(ExcelCellName leftTopCell, ExcelCellName rightBottomCell)
 {
     return new ExcelFormatter(leftTopCell, rightBottomCell, this);
 }
Example #7
0
 public ExcelCell GetCellAt(ExcelCellName excelCell)
 {
     return GetCellAt(excelCell.RowNumber, excelCell.ColumnLetter.ToColumnNumber());
 }
Example #8
0
 public ExcelFormatter GetFormatterAt(ExcelCellName cell)
 {
     return GetFormatterAt(cell, cell);
 }