示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        public ICell this[string cellId]
        {
            get
            {
                if (cellId == null)
                {
                    throw new ArgumentNullException(nameof(cellId));
                }

                var(row, column) = ExcelNumber.ToIndexes(cellId);

                return(this[row][column]);
            }
        }
示例#4
0
 public void ParseNullId()
 {
     Assert.That(() => ExcelNumber.ToIndexes(null), Throws.ArgumentNullException);
 }
示例#5
0
 public void ParseInvalidId(string id)
 {
     Assert.That(() => ExcelNumber.ToIndexes(id), Throws.Exception.TypeOf <FormatException>());
 }