68 references to new
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (6)
DocumentExtractionDocumentBuilderTests.cs (6)
173
vertices[0] =
new
(999, 999);
406
private static ExtractionDocumentPoint[] Polygon() => [
new
(10.25, 20.5),
new
(40.75, 18.25),
new
(44.5, 60.125),
new
(12.875, 58.75),
new
(8.5, 35.25)];
Microsoft.Extensions.Documents.Abstractions.Tests (62)
DocumentAnnotationTestData.cs (5)
18
new
(10.25, 20.5),
new
(40.75, 18.25),
new
(44.5, 60.125),
19
new
(12.875, 58.75),
new
(8.5, 35.25)
DocumentReferencesTests.cs (26)
106
ExtractionDocumentPoint[] points = [
new
(1, 2),
new
(3, 4),
new
(5, 6)];
110
points[2] =
new
(9, 10);
111
Assert.Equal(new[] { new
ExtractionDocumentPoint
(1, 2), new
ExtractionDocumentPoint
(3, 4), new
ExtractionDocumentPoint
(5, 6) }, reference.Polygon);
120
List<ExtractionDocumentPoint> points = [
new
(1.25, 2.5),
new
(3.75, 4.5),
new
(5.25, 6.5)];
141
points[0] =
new
(99, 100);
143
points.Add(
new
(101, 102));
144
points.Add(
new
(103, 104));
155
Assert.Throws<NotSupportedException>(() => polygon.Add(
new
(7, 8)));
176
yield return
new
(i, i + 1);
211
supplied[0] = new
ExtractionDocumentPoint
(999, 999);
236
new
(20.5, 159),
new
(81.5, 163.5),
new
(89, 79.75),
237
new
(25.75, 82.5),
new
(17, 129.5)
286
Assert.Throws<ArgumentOutOfRangeException>("x", () => new
ExtractionDocumentPoint
(value, 2));
287
Assert.Throws<ArgumentOutOfRangeException>("y", () => new
ExtractionDocumentPoint
(2, value));
364
Assert.Throws<ArgumentException>("polygon", () => new ExtractionDocumentSourceReference(page, new[] { new
ExtractionDocumentPoint
(1, 2), new
ExtractionDocumentPoint
(3, 4) }));
383
result[i] = new
ExtractionDocumentPoint
(2 * region.Polygon[i].X, 2 * (100 - region.Polygon[i].Y));
DocumentReviewFollowUpTests.cs (5)
210
ExtractionDocumentPoint point =
new
(1.25, -2.5);
211
ExtractionDocumentPoint equalPoint =
new
(1.25, -2.5);
212
ExtractionDocumentPoint differentPoint =
new
(1.25, 2.5);
221
Assert.True(new
ExtractionDocumentPoint
(0, -0.0) == default);
222
Assert.Equal(default(ExtractionDocumentPoint).GetHashCode(), new
ExtractionDocumentPoint
(0, -0.0).GetHashCode());
DocumentTableCellCollectionTests.cs (18)
138
ExtractionDocumentSourceReference firstSource = new(page, [
new
(1.25, 2.5),
new
(3.75, 2.5),
new
(1.25, 4.5)]);
139
ExtractionDocumentSourceReference imageSource = new(page, [
new
(5.25, 6.5),
new
(7.75, 6.5),
new
(5.25, 8.5)]);
140
ExtractionDocumentSourceReference lastSource = new(page, [
new
(9.25, 10.5),
new
(11.75, 10.5),
new
(9.25, 12.5)]);
218
Assert.Equal(new ExtractionDocumentPoint[] {
new
(1.25, 2.5),
new
(3.75, 2.5),
new
(1.25, 4.5) }, firstSource.Polygon);
219
Assert.Equal(new ExtractionDocumentPoint[] {
new
(5.25, 6.5),
new
(7.75, 6.5),
new
(5.25, 8.5) }, imageSource.Polygon);
220
Assert.Equal(new ExtractionDocumentPoint[] {
new
(9.25, 10.5),
new
(11.75, 10.5),
new
(9.25, 12.5) }, lastSource.Polygon);
DocumentTableCellTests.cs (5)
163
new
(20.5, 159),
new
(81.5, 163.5),
new
(89, 79.75),
new
(25.75, 82.5),
new
(17, 129.5)
PreviewContractTests.cs (3)
90
ExtractionDocumentPoint[] polygon = [
new
(10, 20),
new
(30, 10),
new
(40, 35)];