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