Esempio n. 1
0
 public void Should_getaddress_correctly()
 {
     Check.That(ExcelService.GetAddressCol(1)).IsEqualTo("A");
     Check.That(ExcelService.GetAddressRow(2)).IsEqualTo("2");
     Check.That(ExcelService.GetAddress(03, "A")).IsEqualTo("A3");
     Check.That(ExcelService.GetAddress(04, 1)).IsEqualTo("A4");
     Check.That(ExcelService.GetAddress(05, true, "A", true)).IsEqualTo("$A$5"); Check.That(ExcelService.GetAddress(05, false, "A", false)).IsEqualTo("A5");
     Check.That(ExcelService.GetAddress(06, true, 1, true)).IsEqualTo("$A$6"); Check.That(ExcelService.GetAddress(06, false, 1, false)).IsEqualTo("A6");
     Check.That(ExcelService.GetAddress(07, "A", true)).IsEqualTo("$A$7"); Check.That(ExcelService.GetAddress(07, "A", false)).IsEqualTo("A7");
     Check.That(ExcelService.GetAddress(08, 1, true)).IsEqualTo("$A$8"); Check.That(ExcelService.GetAddress(08, 1, false)).IsEqualTo("A8");
     Check.That(ExcelService.GetAddress(09, "A", 09, "A")).IsEqualTo("A9"); Check.That(ExcelService.GetAddress(09, "A", 09, "B")).IsEqualTo("A9:B9");
     Check.That(ExcelService.GetAddress(10, 1, 10, 1)).IsEqualTo("A10"); Check.That(ExcelService.GetAddress(10, 1, 10, 2)).IsEqualTo("A10:B10");
     Check.That(ExcelService.GetAddress(11, "A", 11, "B", true)).IsEqualTo("$A$11:$B$11");
     Check.That(ExcelService.GetAddress(12, 1, 12, 2, true)).IsEqualTo("$A$12:$B$12");
     Check.That(ExcelService.GetAddress(13, "A", 13, "B", true, true, true, true)).IsEqualTo("$A$13:$B$13");
     Check.That(ExcelService.GetAddress(14, 1, 14, 2, true, true, true, true)).IsEqualTo("$A$14:$B$14");
     Check.That(ExcelService.GetAddress(Address.Cell, 15, "A")).IsEqualTo("^17:15:1");
     Check.That(ExcelService.GetAddress(Address.Cell, 16, 1)).IsEqualTo("^17:16:1");
     Check.That(ExcelService.GetAddress(Address.Range, 17, "A", 17, "B")).IsEqualTo("^18:17:1:17:2");
     Check.That(ExcelService.GetAddress(Address.Range, 18, 1, 18, 2)).IsEqualTo("^18:18:1:18:2");
     Check.That(ExcelService.GetAddress(_excelContext, Address.Cell, 19, "A")).IsEqualTo("B20");
     Check.That(ExcelService.GetAddress(_excelContext, Address.Cell, 20, 1)).IsEqualTo("B21");
     Check.That(ExcelService.GetAddress(_excelContext, Address.Range, 21, "A", 21, "B")).IsEqualTo("B22:C22");
     Check.That(ExcelService.GetAddress(_excelContext, Address.Range, 22, 1, 22, 2)).IsEqualTo("B23:C23");
 }
Esempio n. 2
0
 public static object GetCellsValue(this IExcelContext ctx, Address r, int row, int col, CellValueKind valueKind = CellValueKind.Value) => ctx.GetCellsValue(ExcelService.GetAddress(r, row, col), valueKind);
Esempio n. 3
0
 public static object GetCellsValue(this IExcelContext ctx, Address r, int fromRow, int fromCol, int toRow, int toCol, CellValueKind valueKind = CellValueKind.Value) => ctx.GetCellsValue(ExcelService.GetAddress(r, fromRow, fromCol, toRow, toCol), valueKind);
Esempio n. 4
0
 public static void CellsValue(this IExcelContext ctx, int fromRow, int fromCol, int toRow, int toCol, object value, CellValueKind valueKind = CellValueKind.Value) => ctx.CellsValue(ExcelService.GetAddress(fromRow, fromCol, toRow, toCol), value, valueKind);
Esempio n. 5
0
 public static void CellsValue(this IExcelContext ctx, Address r, object value, CellValueKind valueKind = CellValueKind.Value) => ctx.CellsValue(ExcelService.GetAddress(r, 0, 0), value, valueKind);
Esempio n. 6
0
 public static void CellsValue(this IExcelContext ctx, int row, int col, object value, CellValueKind valueKind = CellValueKind.Value) => ctx.CellsValue(ExcelService.GetAddress(row, col), value, valueKind);
Esempio n. 7
0
 public static void CellsStyle(this IExcelContext ctx, Address r, int fromRow, int fromCol, int toRow, int toCol, params string[] styles) => CellsStyle(ctx, ExcelService.GetAddress(r, fromRow, fromCol, toRow, toCol), styles);
Esempio n. 8
0
 public static void CellsStyle(this IExcelContext ctx, Address r, int row, int col, params string[] styles) => CellsStyle(ctx, ExcelService.GetAddress(r, row, col), styles);
Esempio n. 9
0
 public static void ConditionalFormatting(this IExcelContext ctx, Address r, int fromRow, int fromCol, int toRow, int toCol, object value, ConditionalFormattingKind formattingKind, int?priority, bool stopIfTrue) => ConditionalFormatting(ctx, ExcelService.GetAddress(r, fromRow, fromCol, toRow, toCol), value, formattingKind, priority, stopIfTrue);
Esempio n. 10
0
 public static void ConditionalFormatting(this IExcelContext ctx, int row, int col, object value, ConditionalFormattingKind formattingKind, int?priority, bool stopIfTrue) => ConditionalFormatting(ctx, ExcelService.GetAddress(row, col), value, formattingKind, priority, stopIfTrue);