68 instantiations of ExtractionDocumentPoint
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)];
41 references to ExtractionDocumentPoint
Microsoft.Extensions.DocumentExtraction.Abstractions.Tests (2)
DocumentExtractionDocumentBuilderTests.cs (2)
171ExtractionDocumentPoint[] vertices = Polygon(); 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 (12)
ExtractionDocumentSources.cs (12)
40public readonly struct ExtractionDocumentPoint : IEquatable<ExtractionDocumentPoint> 42/// <summary>Initializes a new instance of the <see cref="ExtractionDocumentPoint"/> struct.</summary> 58public bool Equals(ExtractionDocumentPoint other) => X.Equals(other.X) && Y.Equals(other.Y); 61public override bool Equals(object? obj) => obj is ExtractionDocumentPoint other && Equals(other); 67public static bool operator ==(ExtractionDocumentPoint left, ExtractionDocumentPoint right) 73public static bool operator !=(ExtractionDocumentPoint left, ExtractionDocumentPoint right) 191IEnumerable<ExtractionDocumentPoint>? polygon = null, 195Polygon = new ReadOnlyCollection<ExtractionDocumentPoint>((polygon ?? Array.Empty<ExtractionDocumentPoint>()).ToArray()); 208public IReadOnlyList<ExtractionDocumentPoint> Polygon { get; }
Microsoft.Extensions.Documents.Abstractions.Tests (27)
DocumentAnnotationTestData.cs (1)
16internal static ExtractionDocumentPoint[] Polygon() =>
DocumentExtensionElementTests.cs (1)
92Assert.Throws<NotSupportedException>(() => ((System.Collections.Generic.IList<ExtractionDocumentPoint>)first.Polygon).Clear());
DocumentReferencesTests.cs (16)
82ExtractionDocumentSourceReference reference = new(page, empty ? Array.Empty<ExtractionDocumentPoint>() : null, native); 100Assert.Throws<ArgumentException>("polygon", () => new ExtractionDocumentSourceReference(new("page", 1), new ExtractionDocumentPoint[count])); 106ExtractionDocumentPoint[] points = [new(1, 2), new(3, 4), new(5, 6)]; 120List<ExtractionDocumentPoint> points = [new(1.25, 2.5), new(3.75, 4.5), new(5.25, 6.5)]; 121ExtractionDocumentPoint[] expected = points.ToArray(); 126IEnumerable<ExtractionDocumentPoint> EnumerateOnce() 133foreach (ExtractionDocumentPoint point in points) 152IList<ExtractionDocumentPoint> polygon = Assert.IsAssignableFrom<IList<ExtractionDocumentPoint>>(reference.Polygon); 167IEnumerable<ExtractionDocumentPoint> EnumerateOnce() 208ExtractionDocumentPoint[] supplied = DocumentAnnotationTestData.Polygon(); 227Assert.Throws<NotSupportedException>(() => ((System.Collections.Generic.IList<ExtractionDocumentPoint>)region.Polygon)[0] = default); 234ExtractionDocumentPoint[] expected = 374private static ExtractionDocumentPoint[]? ProjectKnownOverlay(ExtractionDocumentSourceReference region) 380ExtractionDocumentPoint[] result = new ExtractionDocumentPoint[region.Polygon.Count];
DocumentReviewFollowUpTests.cs (4)
210ExtractionDocumentPoint point = new(1.25, -2.5); 211ExtractionDocumentPoint equalPoint = new(1.25, -2.5); 212ExtractionDocumentPoint differentPoint = new(1.25, 2.5); 222Assert.Equal(default(ExtractionDocumentPoint).GetHashCode(), new ExtractionDocumentPoint(0, -0.0).GetHashCode());
DocumentTableCellCollectionTests.cs (3)
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 (1)
161ExtractionDocumentPoint[] rasterPolygon =
PreviewContractTests.cs (1)
90ExtractionDocumentPoint[] polygon = [new(10, 20), new(30, 10), new(40, 35)];