57 references to new
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (2)
DocumentExtractionDocumentBuilderTests.cs (2)
114ExtractionDocumentSourceReference reference = new(frame, Polygon()); 172ExtractionDocumentSourceReference reference = new(frame, vertices, native);
Microsoft.Extensions.DocumentExtraction.Tests (2)
DocumentExtractionMiddlewareTests.cs (2)
371ExtractionDocumentSourceReference reference = new(new ExtractionDocumentSourcePage("frame", 7), rawRepresentation: native); 524ExtractionDocumentSourceReference reference = new(new ExtractionDocumentSourcePage("frame", 7), rawRepresentation: native);
Microsoft.Extensions.Documents.Abstractions.Tests (53)
DocumentElementTests.cs (10)
42ExtractionDocumentSourceReference first = new(page); 43ExtractionDocumentSourceReference duplicate = new(page); 44ExtractionDocumentSourceReference last = new(new("page-2", 2)); 63ExtractionDocumentSourceReference first = new(new("first", 1)); 64ExtractionDocumentSourceReference second = new(new("second", 2)); 86ExtractionDocumentSourceReference firstSource = new(new("first-page", 1), rawRepresentation: firstContent); 87ExtractionDocumentSourceReference secondSource = new(new("second-page", 2), rawRepresentation: secondContent); 113ExtractionDocumentSourceReference page = new(new("page-raw", 1)); 196ExtractionDocumentSourceReference region = new(polygonOnly, DocumentAnnotationTestData.Polygon()); 249element.Sources.Add(new ExtractionDocumentSourceReference(page, rawRepresentation: native));
DocumentExtensionElementTests.cs (2)
68ExtractionDocumentSourceReference first = new(DocumentAnnotationTestData.PdfPage(), DocumentAnnotationTestData.Polygon(), attributes); 69ExtractionDocumentSourceReference second = new(new ExtractionDocumentSourcePage("frame-2", 2), DocumentAnnotationTestData.Polygon());
DocumentImageElementTests.cs (1)
100image.Sources.Add(new ExtractionDocumentSourceReference(page, DocumentAnnotationTestData.Polygon()));
DocumentReferencesTests.cs (15)
82ExtractionDocumentSourceReference reference = new(page, empty ? Array.Empty<ExtractionDocumentPoint>() : null, native); 83ExtractionDocumentSourceReference omitted = new(page); 100Assert.Throws<ArgumentException>("polygon", () => new ExtractionDocumentSourceReference(new("page", 1), new ExtractionDocumentPoint[count])); 109ExtractionDocumentSourceReference reference = new(page, points, native); 139ExtractionDocumentSourceReference reference = new(page, EnumerateOnce(), native); 183ExtractionDocumentSourceReference reference = new(page, EnumerateOnce()); 190Assert.Throws<ArgumentException>("polygon", () => new ExtractionDocumentSourceReference(page, EnumerateOnce())); 210ExtractionDocumentSourceReference region = new(page, supplied); 233ExtractionDocumentSourceReference pdf = new(DocumentAnnotationTestData.PdfPage(), DocumentAnnotationTestData.Polygon()); 241ExtractionDocumentSourceReference raster = new(rasterPage, expected); 258ExtractionDocumentSourceReference region = new(page, DocumentAnnotationTestData.Polygon()); 272ExtractionDocumentSourceReference reference = new(page, DocumentAnnotationTestData.Polygon()); 292ExtractionDocumentSourceReference valid = new(DocumentAnnotationTestData.PdfPage(), DocumentAnnotationTestData.Polygon()); 363Assert.Throws<ArgumentNullException>("page", () => new ExtractionDocumentSourceReference(null!)); 364Assert.Throws<ArgumentException>("polygon", () => new ExtractionDocumentSourceReference(page, new[] { new ExtractionDocumentPoint(1, 2), new ExtractionDocumentPoint(3, 4) }));
DocumentReviewFollowUpTests.cs (2)
151ExtractionDocumentSourceReference reference = new(page); 191text.Sources.Add(new(named));
DocumentTableCellCollectionTests.cs (7)
137ExtractionDocumentSourceReference cellSource = new(page, DocumentAnnotationTestData.Polygon()); 138ExtractionDocumentSourceReference firstSource = new(page, [new(1.25, 2.5), new(3.75, 2.5), new(1.25, 4.5)]); 139ExtractionDocumentSourceReference imageSource = new(page, [new(5.25, 6.5), new(7.75, 6.5), new(5.25, 8.5)]); 140ExtractionDocumentSourceReference lastSource = new(page, [new(9.25, 10.5), new(11.75, 10.5), new(9.25, 12.5)]); 390text.Sources.Add(new(new("merged-page", 1), rawRepresentation: stream)); 446candidateText.Sources.Add(new(new("candidate-page", 1), rawRepresentation: stream)); 509oldAnchor.Sources.Add(new ExtractionDocumentSourceReference(frame, DocumentAnnotationTestData.Polygon()));
DocumentTableCellTests.cs (4)
121empty.Sources.Add(new ExtractionDocumentSourceReference(page, DocumentAnnotationTestData.Polygon())); 136empty.Sources.Add(new ExtractionDocumentSourceReference(page)); 166empty.Sources.Add(new ExtractionDocumentSourceReference(pdf, DocumentAnnotationTestData.Polygon())); 167empty.Sources.Add(new ExtractionDocumentSourceReference(raster, rasterPolygon));
DocumentTableElementTests.cs (4)
306empty.Sources.Add(new ExtractionDocumentSourceReference(frame, DocumentAnnotationTestData.Polygon(), "NATIVE_ONLY")); 342table.Sources.Add(new ExtractionDocumentSourceReference(new ExtractionDocumentSourcePage("provider-page", 1), rawRepresentation: providerMarkdown)); 365table.Sources.Add(new ExtractionDocumentSourceReference(new ExtractionDocumentSourcePage("provider-page", 1), rawRepresentation: providerMarkdown)); 388table.Sources.Add(new ExtractionDocumentSourceReference(new ExtractionDocumentSourcePage("provider-page", 1), rawRepresentation: providerMarkdown));
DocumentTests.Composition.cs (1)
58ExtractionDocumentSourceReference reference = new(page, rawRepresentation: native);
DocumentTests.cs (3)
163ExtractionDocumentSourceReference region = new(page7, DocumentAnnotationTestData.Polygon()); 165text2.Sources.Add(new ExtractionDocumentSourceReference(page2, DocumentAnnotationTestData.Polygon())); 239text.Sources.Add(new ExtractionDocumentSourceReference(page, DocumentAnnotationTestData.Polygon()));
DocumentTests.StandardContent.cs (1)
395ExtractionDocumentSourceReference reference = new(page);
DocumentTextElementTests.cs (1)
37ExtractionDocumentSourceReference citation = new(page, DocumentAnnotationTestData.Polygon());
PreviewContractTests.cs (2)
91text.Sources.Add(new(named)); 92text.Sources.Add(new(seven, polygon));