83 instantiations of ExtractionDocumentTableCell
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (2)
DocumentExtractionDocumentBuilderTests.cs (2)
121table.Cells[0, 0] = new ExtractionDocumentTableCell(content); 153table.Cells[0, 0] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("replacement")));
Microsoft.Extensions.Documents.Abstractions.Tests (81)
DocumentReferencesTests.cs (1)
366ExtractionDocumentTableCell cell = new();
DocumentReviewFollowUpTests.cs (6)
24Assert.IsType<List<ExtractionDocumentSourceReference>>(new ExtractionDocumentTableCell().Sources); 124outer.Cells[0, 0] = new(inner); 125outer.Cells[0, 1] = new(inner); 126inner.Cells[0, 0] = new(shared); 135inner.Cells[0, 0] = new(outer); 149ExtractionDocumentTableCell cell = new(text);
DocumentTableCellCollectionTests.cs (25)
21table.Cells[0, 1] = new ExtractionDocumentTableCell(firstContent); 22table.Cells[1, 2] = new ExtractionDocumentTableCell(lastContent); 48table.Cells[0, 0] = new ExtractionDocumentTableCell(content); 68table.Cells[0, 0] = new ExtractionDocumentTableCell(image); 89table.Cells[0, 0] = new ExtractionDocumentTableCell(oldContent); 92table.Cells[0, 0] = new ExtractionDocumentTableCell(replacementContent); 113ExtractionDocumentTableCell cell = new(content); 163ExtractionDocumentTableCell cell = new(mixed, 2, 2, "rowHeader"); 259ExtractionDocumentTableCell cell = new(mixed); 270innerTable.Cells[0, 0] = new ExtractionDocumentTableCell(root); 303Assert.Throws<InvalidOperationException>(() => table.Cells[0, 0] = new ExtractionDocumentTableCell(table)); 314outerTable.Cells[0, 0] = new ExtractionDocumentTableCell(innerTable); 316innerTable.Cells[0, 0] = new ExtractionDocumentTableCell(outerTable); 337table.Cells[0, 0] = new ExtractionDocumentTableCell(content); 358ExtractionDocumentTableCell anchor = new(new ExtractionDocumentTextElement(new TextContent("MERGED_A")), 2, 2, "header"); 359ExtractionDocumentTableCell ordinary = new(new ExtractionDocumentTextElement(new TextContent("B"))); 391ExtractionDocumentTableCell anchor = new(text, 2, 2); 396ExtractionDocumentTableCell overlap = new(2, 1); 397ExtractionDocumentTableCell candidate = new(); 426ExtractionDocumentTableCell candidate = new(rowSpan, columnSpan); 440ExtractionDocumentTableCell anchor = new(anchorText, 2, 2); 447ExtractionDocumentTableCell candidate = new(candidateText, 2, 1); 508ExtractionDocumentTableCell oldAnchor = new(oldText, 2, 2, "rowHeader"); 519ExtractionDocumentTableCell replacement = new(replacementText); 535ExtractionDocumentTableCell empty = new();
DocumentTableCellTests.cs (12)
21table.Cells[1, 0] = new ExtractionDocumentTableCell(content); 40table.Cells[0, 0] = new ExtractionDocumentTableCell(content); 63() => new ExtractionDocumentTableCell(null!)); 79ExtractionDocumentTableCell content = new(text, role: role); 80ExtractionDocumentTableCell empty = new(role: role); 107Assert.Throws<ArgumentException>(nameof(role), () => new ExtractionDocumentTableCell(text, role: role)); 108Assert.Throws<ArgumentException>(nameof(role), () => new ExtractionDocumentTableCell(role: role)); 118ExtractionDocumentTableCell empty = new(); 148Assert.Throws<ArgumentOutOfRangeException>(parameter, () => new ExtractionDocumentTableCell(rowSpan, columnSpan)); 149Assert.Throws<ArgumentOutOfRangeException>(parameter, () => new ExtractionDocumentTableCell(text, rowSpan, columnSpan)); 165ExtractionDocumentTableCell empty = new(); 169ExtractionDocumentTableCell ordinary = new(text);
DocumentTableElementTests.cs (28)
21inner.Cells[0, 0] = new ExtractionDocumentTableCell(leaf); 22middle.Cells[0, 0] = new ExtractionDocumentTableCell(inner); 23outer.Cells[0, 0] = new ExtractionDocumentTableCell(middle); 40ExtractionDocumentTableCell first = new(text, role: "vendor|\"<"); 42inner.Cells[0, 1] = new ExtractionDocumentTableCell(image); 44outer.Cells[0, 0] = new ExtractionDocumentTableCell(inner); 62ExtractionDocumentTableCell wide = new(new ExtractionDocumentTextElement(new TextContent("wide")), 2, 3); 63ExtractionDocumentTableCell corner = new(new ExtractionDocumentTextElement(new TextContent("corner")), role: "rowHeader"); 68Assert.Throws<InvalidOperationException>(() => table.Cells[1, 1] = new ExtractionDocumentTableCell()); 69Assert.Throws<InvalidOperationException>(() => table.Cells[0, 3] = new ExtractionDocumentTableCell(3, 1)); 70Assert.Throws<ArgumentException>(() => table.Cells[0, 0] = new ExtractionDocumentTableCell(4, 1)); 73ExtractionDocumentTableCell small = new(new ExtractionDocumentTextElement(new TextContent("small"))); 145ExtractionDocumentTableCell candidate = new(text); 167table.Cells[0, 1] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("one"))); 168table.Cells[1, 0] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("two"))); 183table.Cells[0, 0] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("left|right"))); 192table.Cells[0, 0] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("semantic cell"))); 202ExtractionDocumentTableCell anchor = new(new ExtractionDocumentTextElement(new TextContent("MERGED_A<&")), 2, 2, "columnHeader"); 204table.Cells[2, 0] = new ExtractionDocumentTableCell(new ExtractionDocumentTextElement(new TextContent("B")), role: "rowHeader"); 205ExtractionDocumentTableCell empty = new(role: "vendor\"role"); 236ExtractionDocumentTableCell cell = new(text, role: role); 258ExtractionDocumentTableCell empty = new(); 260ExtractionDocumentTableCell anchor = new(text, rowSpan, columnSpan); 303ExtractionDocumentTableCell empty = new(); 309table.Cells[0, 2] = new ExtractionDocumentTableCell(text); 366ExtractionDocumentTableCell empty = new(); 390ExtractionDocumentTableCell populated = new(text); 391ExtractionDocumentTableCell empty = new();
DocumentTests.Composition.cs (4)
31ExtractionDocumentTableCell empty = new(); 34table.Cells[0, 1] = new ExtractionDocumentTableCell(cellText); 91table.Cells[0, 0] = new ExtractionDocumentTableCell(cellText); 92table.Cells[0, 1] = new ExtractionDocumentTableCell();
DocumentTests.StandardContent.cs (5)
135table.Cells[0, 0] = new ExtractionDocumentTableCell(cellContent); 170table.Cells[0, 0] = new ExtractionDocumentTableCell(cellText); 220table.Cells[0, 0] = new ExtractionDocumentTableCell(text); 400ExtractionDocumentTableCell firstCell = new(first); 403table.Cells[0, 1] = new ExtractionDocumentTableCell(second);
87 references to ExtractionDocumentTableCell
Microsoft.Extensions.Documents.Abstractions (16)
ExtractionDocumentTable.cs (16)
47/// Initializes a new instance of the <see cref="ExtractionDocumentTableCell"/> class. 61/// <summary>Initializes a new instance of the <see cref="ExtractionDocumentTableCell"/> class without content.</summary> 125public sealed class ExtractionDocumentTableCellCollection : IEnumerable<ExtractionDocumentTableCell?> 128private readonly ExtractionDocumentTableCell?[,] _cells; 129private readonly ExtractionDocumentTableCell?[,] _coveringCells; 134_cells = new ExtractionDocumentTableCell?[rowCount, columnCount]; 135_coveringCells = new ExtractionDocumentTableCell?[rowCount, columnCount]; 157public ExtractionDocumentTableCell? this[int row, int column] 173ExtractionDocumentTableCell? oldCell = _cells[row, column]; 202internal ExtractionDocumentTableCell? GetCoveringCell(int row, int column) 214public IEnumerator<ExtractionDocumentTableCell?> GetEnumerator() 227private void ValidateCanAdd(ExtractionDocumentTableCell cell) 240private void ValidateSpan(int row, int column, ExtractionDocumentTableCell cell, ExtractionDocumentTableCell? replaced) 267private void SetCoverage(ExtractionDocumentTableCell cell, ExtractionDocumentTableCell? covering)
Microsoft.Extensions.Documents.Abstractions.Tests (71)
DocumentReferencesTests.cs (9)
24foreach (Type type in new[] { typeof(ExtractionDocument), typeof(ExtractionDocumentElement), typeof(ExtractionDocumentTableCell) }) 34foreach (Type type in new[] { typeof(ExtractionDocumentElement), typeof(ExtractionDocumentTableCell) }) 56Assert.Null(typeof(ExtractionDocumentTableCell).GetProperty("Kind")); 57Assert.Null(typeof(ExtractionDocumentTableCell).GetProperty("CellKind")); 58Assert.Equal(typeof(string), typeof(ExtractionDocumentTableCell).GetProperty("Role")!.PropertyType); 59Assert.False(typeof(ExtractionDocumentTableCell).GetProperty("Role")!.CanWrite); 61Assert.Equal(typeof(ExtractionDocumentTableCell), indexer.PropertyType); 64Assert.All(typeof(ExtractionDocumentTableCell).GetConstructors(), constructor => 366ExtractionDocumentTableCell cell = new();
DocumentReviewFollowUpTests.cs (1)
149ExtractionDocumentTableCell cell = new(text);
DocumentTableCellCollectionTests.cs (25)
24ExtractionDocumentTableCell?[] cells = table.Cells.ToArray(); 34new ExtractionDocumentTableCell?[] { null, cells[1], null, null, null, cells[5] }, 50ExtractionDocumentTableCell cell = table.Cells[0, 0]!; 90ExtractionDocumentTableCell oldCell = table.Cells[0, 0]!; 94ExtractionDocumentTableCell replacementCell = table.Cells[0, 0]!; 113ExtractionDocumentTableCell cell = new(content); 163ExtractionDocumentTableCell cell = new(mixed, 2, 2, "rowHeader"); 259ExtractionDocumentTableCell cell = new(mixed); 338ExtractionDocumentTableCell cell = table.Cells[0, 0]!; 358ExtractionDocumentTableCell anchor = new(new ExtractionDocumentTextElement(new TextContent("MERGED_A")), 2, 2, "header"); 359ExtractionDocumentTableCell ordinary = new(new ExtractionDocumentTextElement(new TextContent("B"))); 379Assert.Equal(new ExtractionDocumentTableCell?[] { anchor, null, null, null, null, null, ordinary, null, null }, table.Cells.ToArray()); 391ExtractionDocumentTableCell anchor = new(text, 2, 2); 395ExtractionDocumentTableCell?[] before = table.Cells.ToArray(); 396ExtractionDocumentTableCell overlap = new(2, 1); 397ExtractionDocumentTableCell candidate = new(); 426ExtractionDocumentTableCell candidate = new(rowSpan, columnSpan); 440ExtractionDocumentTableCell anchor = new(anchorText, 2, 2); 447ExtractionDocumentTableCell candidate = new(candidateText, 2, 1); 448ExtractionDocumentTableCell?[] before = table.Cells.ToArray(); 508ExtractionDocumentTableCell oldAnchor = new(oldText, 2, 2, "rowHeader"); 519ExtractionDocumentTableCell replacement = new(replacementText); 535ExtractionDocumentTableCell empty = new(); 555ExtractionDocumentTableCell? covering = null; 575new ExtractionDocumentTableCell?[]
DocumentTableCellTests.cs (8)
25ExtractionDocumentTableCell cell = table.Cells[1, 0]!; 45ExtractionDocumentTableCell cell = table.Cells[0, 0]!; 79ExtractionDocumentTableCell content = new(text, role: role); 80ExtractionDocumentTableCell empty = new(role: role); 92Assert.Equal(new ExtractionDocumentTableCell?[] { content, empty }, table.Cells); 118ExtractionDocumentTableCell empty = new(); 165ExtractionDocumentTableCell empty = new(); 169ExtractionDocumentTableCell ordinary = new(text);
DocumentTableElementTests.cs (26)
40ExtractionDocumentTableCell first = new(text, role: "vendor|\"<"); 62ExtractionDocumentTableCell wide = new(new ExtractionDocumentTextElement(new TextContent("wide")), 2, 3); 63ExtractionDocumentTableCell corner = new(new ExtractionDocumentTextElement(new TextContent("corner")), role: "rowHeader"); 73ExtractionDocumentTableCell small = new(new ExtractionDocumentTextElement(new TextContent("small"))); 81void AssertCoverage(ExtractionDocumentTableCell? anchor, int rows, int columns) 88ExtractionDocumentTableCell? cornerCell = row == 2 && column == 3 ? corner : null; 89ExtractionDocumentTableCell? expected = inSpan ? anchor : cornerCell; 109new ExtractionDocumentTableCell?[] { null, null, null, null, null, null }, 145ExtractionDocumentTableCell candidate = new(text); 159new ExtractionDocumentTableCell?[] { null, null, null, null }, 202ExtractionDocumentTableCell anchor = new(new ExtractionDocumentTextElement(new TextContent("MERGED_A<&")), 2, 2, "columnHeader"); 205ExtractionDocumentTableCell empty = new(role: "vendor\"role"); 207ExtractionDocumentTableCell?[] before = table.Cells.ToArray(); 236ExtractionDocumentTableCell cell = new(text, role: role); 258ExtractionDocumentTableCell empty = new(); 260ExtractionDocumentTableCell anchor = new(text, rowSpan, columnSpan); 275new ExtractionDocumentTableCell?[] { empty, null, null, null, null, anchor, null, null, null, null, null, null }, 282ExtractionDocumentTableCell? covering = inSpan ? anchor : null; 303ExtractionDocumentTableCell empty = new(); 348Assert.Equal(new ExtractionDocumentTableCell?[] { null, null, null, null }, table.Cells.ToArray()); 355Assert.Equal(new ExtractionDocumentTableCell?[] { null, null, null, null }, table.Cells.ToArray()); 366ExtractionDocumentTableCell empty = new(); 374Assert.Equal(new ExtractionDocumentTableCell?[] { null, null, null, empty }, table.Cells.ToArray()); 390ExtractionDocumentTableCell populated = new(text); 391ExtractionDocumentTableCell empty = new(); 407Assert.Equal(new ExtractionDocumentTableCell?[] { null, null, null, null }, table.Cells.ToArray());
DocumentTests.Composition.cs (1)
31ExtractionDocumentTableCell empty = new();
DocumentTests.StandardContent.cs (1)
400ExtractionDocumentTableCell firstCell = new(first);