Exemple #1
0
        public void ExtractContent_ThrowsArgumentNullExceptionIfTargetRowIsNull()
        {
            // Arrange
            var dummyLine = new StringSlice("");
            ExposedFlexiTableBlockParser testSubject = CreateExposedFlexiTableBlockParser();

            // Act and assert
            Assert.Throws <ArgumentNullException>(() => testSubject.ExposedExtractContent(dummyLine, null));
        }
Exemple #2
0
        public void ExtractContent_ExtractsContent(string dummyText,
                                                   Row dummyTargetRow,
                                                   string[] expectedCellContent)
        {
            // Arrange
            var dummyLine = new StringSlice(dummyText);
            ExposedFlexiTableBlockParser testSubject = CreateExposedFlexiTableBlockParser();

            // Act
            testSubject.ExposedExtractContent(dummyLine, dummyTargetRow);

            // Assert
            int cellIndex = 0;

            for (int columnIndex = 0; columnIndex < dummyTargetRow.Count;)
            {
                Cell cell = dummyTargetRow[columnIndex];
                Assert.Equal(expectedCellContent[cellIndex++], cell.Lines.ToString());
                columnIndex = cell.EndColumnIndex + 1;
            }
        }