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