public void IsNextAdjacentWorksForSameRow() { var a1 = new CellRef("A1"); var b1 = new CellRef("B1"); b1.IsNextAdjacentTo(a1).Should().BeTrue(); }
public void IsNextAdjacentReturnsFalseForPreviousAdjacentRow() { var a1 = new CellRef("A1"); var a2 = new CellRef("A2"); a1.IsNextAdjacentTo(a2).Should().BeFalse(); }
public void IsNextAdjacentReturnsFalseFoPreviousAdjacentRow() { var a1 = new CellRef("A1"); var b1 = new CellRef("B1"); a1.IsNextAdjacentTo(b1).Should().BeFalse(); }
public void IsNextAdjacentWorksForNextRow() { var a1 = new CellRef("A1"); var a2 = new CellRef("A2"); a2.IsNextAdjacentTo(a1).Should().BeTrue(); }
public void IsNextAdjacentReturnsFalseForNonAdjacent() { var a1 = new CellRef("A1"); var c3 = new CellRef("C3"); a1.IsNextAdjacentTo(c3).Should().BeFalse(); c3.IsNextAdjacentTo(a1).Should().BeFalse(); }
private void GetCellAttributesAndReadValue() { var nextCell = ReadNextCell(); switch (_readNextBehaviour) { case ReadNextBehaviour.SkipNulls: Address = nextCell.Key; Value = nextCell.Value; break; case ReadNextBehaviour.ReadAllNulls: //If first cell read: if (!AddressCelRef.HasValue) { Address = nextCell.Key; Value = nextCell.Value; AddressCelRef = new CellRef(Address); } else { var nextCellRef = new CellRef(nextCell.Key); //If not first cell read bit adjacent to first cell if (nextCellRef.IsNextAdjacentTo(AddressCelRef)) { Address = nextCell.Key; Value = nextCell.Value; AddressCelRef = nextCellRef; } //If not first cell read and not adjacent to first cell else { var nextAdjacent = AddressCelRef.Value.GetNextAdjacent(WorksheetDimension.BottomRight.ColumnNumber); Address = nextAdjacent.ToString(); Value = null; AddressCelRef = nextAdjacent; NextPopulatedCellRef = nextCellRef; NextPopulatedCellValue = nextCell.Value; } } break; default: throw new NotImplementedException(); } }