public void ParseValidId(string id, int expectedRow, int expectedColumn) { var(row, column) = ExcelNumber.ToIndexes(id); Assert.That(row, Is.EqualTo(expectedRow)); Assert.That(column, Is.EqualTo(expectedColumn)); }
private Dictionary <int, ICell> CreateCells(XmlElement rowElement, IReadOnlyList <string> sharedStrings) { var cells = new Dictionary <int, ICell>(); foreach (XmlElement c in rowElement.GetElementsByTagName("c")) { var(_, column) = ExcelNumber.ToIndexes(c.GetAttribute("r")); cells[column] = new Cell(this, column, c, sharedStrings); } return(cells); }
public ICell this[string cellId] { get { if (cellId == null) { throw new ArgumentNullException(nameof(cellId)); } var(row, column) = ExcelNumber.ToIndexes(cellId); return(this[row][column]); } }
public void ParseNullId() { Assert.That(() => ExcelNumber.ToIndexes(null), Throws.ArgumentNullException); }
public void ParseInvalidId(string id) { Assert.That(() => ExcelNumber.ToIndexes(id), Throws.Exception.TypeOf <FormatException>()); }