Skip to content

Commit

Permalink
Added test stubs Normalized in SpatialQueryTestBase
Browse files Browse the repository at this point in the history
- Added related stubs to Sqlite and SqlServer spatial tests

Part of #19957
  • Loading branch information
EricStG authored Feb 24, 2020
1 parent 5d3666d commit 23f9bde
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/EFCore.Specification.Tests/Query/SpatialQueryTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,22 @@ public virtual Task M(bool async)
});
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Normalized(bool async)
{
return AssertQuery(
async,
ss => ss.Set<PolygonEntity>().Select(e => new { e.Id, Normalized = e.Polygon.Normalized() }),
ss => ss.Set<PolygonEntity>().Select(e => new { e.Id, Normalized = e.Polygon == null ? null : e.Polygon.Normalized() }),
elementSorter: x => x.Id,
elementAsserter: (e, a) =>
{
Assert.Equal(e.Id, a.Id);
Assert.Equal(e.Normalized, a.Normalized, GeometryComparer.Instance);
});
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task NumGeometries(bool async)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ public override async Task M(bool async)
FROM [PointEntity] AS [p]");
}

// No SqlServer Translation
public override Task Normalized(bool async)
{
return Task.CompletedTask;
}

public override async Task NumGeometries(bool async)
{
await base.NumGeometries(async);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ public override async Task M(bool async)
FROM [PointEntity] AS [p]");
}

// No SqlServer Translation
public override Task Normalized(bool async)
{
return Task.CompletedTask;
}

public override async Task NumGeometries(bool async)
{
await base.NumGeometries(async);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,12 @@ public override async Task M(bool async)
FROM ""PointEntity"" AS ""p""");
}

// No Sqlite Translation
public override Task Normalized(bool async)
{
return Task.CompletedTask;
}

public override async Task NumGeometries(bool async)
{
await base.NumGeometries(async);
Expand Down

0 comments on commit 23f9bde

Please sign in to comment.