155 references to Elements
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (6)
DelegatingDocumentExtractionClientTests.cs (1)
68
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("**body**"), role: "heading") { HeadingLevel = 3 });
DocumentExtractionDocumentBuilderTests.cs (5)
122
nested.
Elements
.Add(table);
123
root.
Elements
.Add(nested);
134
Assert.Same(nested, Assert.Single(root.
Elements
));
135
Assert.Same(table, Assert.Single(nested.
Elements
));
178
section.
Elements
.Add(image);
Microsoft.Extensions.DocumentExtraction.Tests (3)
DocumentExtractionMiddlewareTests.cs (3)
251
section.
Elements
.Add(new ExtractionDocumentImageElement(new TextContent("visible **text**"), "visible text"));
375
section.
Elements
.Add(image);
528
section.
Elements
.Add(image);
Microsoft.Extensions.Documents.Abstractions (1)
ExtractionDocument.cs (1)
82
foreach (ExtractionDocumentElement element in section.
Elements
)
Microsoft.Extensions.Documents.Abstractions.Tests (145)
DocumentElementTests.cs (18)
19
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("semantic paragraph")));
22
Assert.Equal("semantic paragraph", Assert.IsType<TextContent>(Assert.Single(section.
Elements
).Content).Text);
61
section.
Elements
.Add(element);
97
section.
Elements
.Add(element);
111
section.
Elements
.Add(element);
130
section.
Elements
.Add(section);
132
section.
Elements
.Clear();
135
section.
Elements
.Add(child);
136
child.
Elements
.Add(section);
141
Assert.Single(section.
Elements
);
142
Assert.Same(section, Assert.Single(child.
Elements
));
155
section.
Elements
.Add(element);
173
section.
Elements
.Add(element);
199
section.
Elements
.Add(text);
223
section.
Elements
.Add(text);
252
section.
Elements
.Add(text);
253
section.
Elements
.Add(image);
254
section.
Elements
.Add(extension);
DocumentExtensionElementTests.cs (1)
78
section.
Elements
.Add(extension);
DocumentImageElementTests.cs (2)
73
section.
Elements
.Add(image);
102
section.
Elements
.Add(image);
DocumentReferencesTests.cs (1)
215
section.
Elements
.Add(text);
DocumentReviewFollowUpTests.cs (16)
22
Assert.IsType<List<ExtractionDocumentElement>>(section.
Elements
);
50
section.
Elements
.AddRange([text, text]);
55
section.
Elements
.RemoveAt(0);
72
root.
Elements
.Add(self ? root : child);
75
child.
Elements
.Add(root);
91
section.
Elements
.Add(null!);
104
shared.
Elements
.Add(text);
105
root.
Elements
.Add(shared);
106
root.
Elements
.Add(shared);
110
shared.
Elements
.Add(root);
113
shared.
Elements
.RemoveAt(1);
132
section.
Elements
.AddRange([outer, outer]);
155
section.
Elements
.Add(table);
165
section.
Elements
.Add(table);
173
section.
Elements
.Clear();
192
section.
Elements
.Add(text);
DocumentSectionTests.cs (7)
19
Assert.Empty(section.
Elements
);
29
Assert.Empty(section.
Elements
);
43
nested.
Elements
.Add(nestedFirst);
44
nested.
Elements
.Add(nestedLast);
45
root.
Elements
.Add(first);
46
root.
Elements
.Add(nested);
47
root.
Elements
.Add(last);
DocumentTableCellCollectionTests.cs (25)
46
section.
Elements
.Add(table);
87
section.
Elements
.Add(table);
133
root.
Elements
.Add(table);
160
mixed.
Elements
.Add(first);
161
mixed.
Elements
.Add(image);
162
mixed.
Elements
.Add(last);
184
Assert.Equal(3, mixed.
Elements
.Count);
185
Assert.Same(first, mixed.
Elements
[0]);
186
Assert.Same(image, mixed.
Elements
[1]);
187
Assert.Same(last, mixed.
Elements
[2]);
258
mixed.
Elements
.Add(paragraph);
261
root.
Elements
.Add(table);
269
mixed.
Elements
.Add(innerTable);
274
mixed.
Elements
.Add(root);
281
Assert.Same(paragraph, mixed.
Elements
[0]);
285
Assert.Same(innerTable, mixed.
Elements
[1]);
290
Assert.Same(root, mixed.
Elements
[1]);
319
section.
Elements
.Add(outerTable);
335
section.
Elements
.Add(table);
362
section.
Elements
.Add(table);
393
section.
Elements
.Add(table);
424
section.
Elements
.Add(table);
442
section.
Elements
.Add(table);
480
otherSection.
Elements
.Add(otherTable);
513
section.
Elements
.Add(table);
DocumentTableCellTests.cs (13)
22
section.
Elements
.Add(table);
41
firstSection.
Elements
.Add(table);
47
firstSection.
Elements
.Remove(table);
49
secondSection.
Elements
.Add(table);
54
Assert.Empty(firstSection.
Elements
);
55
Assert.Same(table, Assert.Single(secondSection.
Elements
));
83
section.
Elements
.Add(table);
123
section.
Elements
.Add(table);
176
first.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("first")));
177
second.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("second")));
178
first.
Elements
.Add(table);
184
Assert.True(first.
Elements
.Remove(table));
186
second.
Elements
.Add(table);
DocumentTableElementTests.cs (7)
60
section.
Elements
.Add(table);
238
section.
Elements
.Add(table);
263
section.
Elements
.Add(table);
310
section.
Elements
.Add(table);
343
section.
Elements
.Add(table);
368
section.
Elements
.Add(table);
394
section.
Elements
.Add(table);
DocumentTests.Composition.cs (6)
41
section.
Elements
.Add(element);
94
nested.
Elements
.Add(text);
95
nested.
Elements
.Add(table);
96
section.
Elements
.Add(nested);
97
section.
Elements
.Add(image);
98
section.
Elements
.Add(extension);
DocumentTests.cs (17)
56
section.
Elements
.Add(new ExtractionDocumentImageElement(new TextContent("stored image markdown"))
77
first.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("first semantic")));
78
second.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("second semantic")));
122
nested.
Elements
.Add(nestedText);
123
first.
Elements
.Add(firstText);
124
first.
Elements
.Add(nested);
125
first.
Elements
.Add(image);
126
first.
Elements
.Add(extension);
127
first.
Elements
.Add(table);
128
second.
Elements
.Add(secondText);
145
root.
Elements
.Add(nested);
146
nested.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("content")));
168
first.
Elements
.Add(text7);
169
second.
Elements
.Add(text2);
176
first.
Elements
.Remove(text7);
177
second.
Elements
.Insert(0, text7);
233
section.
Elements
.Add(text);
DocumentTests.StandardContent.cs (29)
39
Assert.Empty(section.
Elements
);
52
inner.
Elements
.Add(text);
53
outer.
Elements
.Add(inner);
60
Assert.Same(inner, Assert.Single(outer.
Elements
));
61
Assert.Same(text, Assert.Single(inner.
Elements
));
74
section.
Elements
.Add(new ExtractionDocumentTextElement(first));
75
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent(string.Empty)));
76
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("last|value")));
92
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("child")));
109
section.
Elements
.Add(new ExtractionDocumentTextElement(new TextContent("first")));
110
section.
Elements
.Add(new CustomElement(new AIContent()));
114
Assert.Equal(section.
Elements
, document.EnumerateContent());
115
Assert.IsType<AIContent>(section.
Elements
[1].Content);
116
Assert.Equal("first", Assert.IsType<TextContent>(section.
Elements
[0].Content).Text);
124
section.
Elements
.Add(custom);
130
section.
Elements
.Insert(0, new ExtractionDocumentTextElement(new TextContent("prefix")));
131
Assert.Equal(section.
Elements
, document.EnumerateContent());
136
section.
Elements
.Add(table);
137
Assert.Equal(section.
Elements
, document.EnumerateContent());
150
section.
Elements
.Add(text);
171
transparent.
Elements
.Add(table);
172
section.
Elements
.Add(transparent);
194
section.
Elements
.Add(image);
221
section.
Elements
.Add(table);
240
section.
Elements
.Add(text);
339
section.
Elements
.Add(element);
341
Assert.Same(element, Assert.Single(section.
Elements
));
373
section.
Elements
.Add(image);
404
section.
Elements
.Add(table);
DocumentTextElementTests.cs (2)
39
section.
Elements
.Add(element);
124
section.
Elements
.Add(element);
PreviewContractTests.cs (1)
94
section.
Elements
.Add(text);