Skip to content

Commit 56d3ef2

Browse files
committed
Npgsql/Geo: Improve NpgsqlPoint assertion as suggested by CodeRabbit
1 parent 9a7d742 commit 56d3ef2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

by-language/csharp-npgsql/tests/DemoProgramTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public async Task TestAllTypesNativeExample()
133133
// `GEO_SHAPE` is communicated as scalar `string` type, using the GeoJSON format.
134134
// TODO: Possibly support transparently converging `GEO_SHAPE` to one of
135135
// `NpgsqlLSeg`, `NpgsqlBox`, `NpgsqlPath`, `NpgsqlPolygon`, `NpgsqlCircle`.
136-
Assert.Equal(new NpgsqlPoint(85.42999997735023, 66.22999997343868), row["geopoint"]);
136+
var geopoint = (NpgsqlPoint) row["geopoint"];
137+
Assert.True(Math.Abs(geopoint.X - 85.43) < 0.0001, "X coordinate mismatch");
138+
Assert.True(Math.Abs(geopoint.Y - 66.23) < 0.0001, "Y coordinate mismatch");
137139
Assert.Equal("""{"coordinates":[[[5.0,5.0],[5.0,10.0],[10.0,10.0],[10.0,5.0],[5.0,5.0]]],"type":"Polygon"}""", row["geoshape"]);
138140

139141
// Vector type

0 commit comments

Comments
 (0)