-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c01f36
commit 9ca9e93
Showing
6 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime.Tests/DateTimeQueryTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace SimplerSoftware.EntityFrameworkCore.SqlServer.NodaTime.Tests | ||
{ | ||
public class DateTimeQueryTests : QueryTestBase | ||
{ | ||
public DateTimeQueryTests(DatabaseTestFixture databaseTestFixture) | ||
: base(databaseTestFixture) { } | ||
|
||
[Fact] | ||
public async Task DateTime_Date_Test() | ||
{ | ||
var raceResults = await this.Db.Race.Where(r => r.DateTimeDate.Date >= new DateTime(2019, 7, 1)).ToListAsync(); | ||
|
||
Assert.Equal( | ||
condense(@$"{RaceSelectStatement} WHERE CONVERT(date, [r].[DateTimeDate]) >= '2019-07-01T00:00:00.0000000'"), | ||
condense(this.Db.Sql)); | ||
|
||
Assert.Equal(6, raceResults.Count); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 7 additions & 6 deletions
13
...ore.SqlServer.NodaTime/Query/ExpressionTranslators/NodaTimeTypesMemberTranslatorPlugin.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters