Skip to content

Commit 17ca1f6

Browse files
committed
Fix tests related to TimeSpan
1 parent d703312 commit 17ca1f6

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con
1818
{
1919
base.OnModelCreating(modelBuilder, context);
2020

21-
/*modelBuilder.Entity<City>().Property(g => g.Location).HasColumnType("varchar(100)");
21+
modelBuilder.Entity<City>().Property(g => g.Location).HasColumnType("varchar(100)");
2222

23-
modelBuilder.Entity<Mission>(
23+
/*modelBuilder.Entity<Mission>(
2424
b =>
2525
{
2626
// Full-text binary search
@@ -34,8 +34,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con
3434
{
3535
b.Ignore(m => m.Date);
3636
b.Ignore(m => m.Time);
37-
b.Ignore(m => m.Timeline);
38-
b.Ignore(m => m.Duration);
37+
//b.Ignore(m => m.Timeline);
38+
//b.Ignore(m => m.Duration);
3939
});
4040
}
4141

test/EFCore.Jet.FunctionalTests/Query/GearsOfWarQueryJetTest.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ public override async Task Non_unicode_parameter_is_used_for_non_unicode_column(
19441944

19451945
AssertSql(
19461946
"""
1947-
@__value_0='Unknown' (Size = 255)
1947+
@__value_0='Unknown' (Size = 100)
19481948
19491949
SELECT `c`.`Name`, `c`.`Location`, `c`.`Nation`
19501950
FROM `Cities` AS `c`
@@ -3057,6 +3057,7 @@ ORDER BY `g`.`FullName`
30573057
public override async Task Take_without_orderby_followed_by_orderBy_is_pushed_down1(bool isAsync)
30583058
{
30593059
await base.Take_without_orderby_followed_by_orderBy_is_pushed_down1(isAsync);
3060+
30603061
AssertSql(
30613062
"""
30623063
SELECT `t`.`FullName`
@@ -5925,7 +5926,7 @@ public override async Task String_concat_on_various_types(bool isAsync)
59255926

59265927
AssertSql(
59275928
"""
5928-
SELECT ('HasSoulPatch ' & (`g`.`HasSoulPatch` & '')) & ' HasSoulPatch', ('Rank ' & (`g`.`Rank` & '')) & ' Rank', ('SquadId ' & (`g`.`SquadId` & '')) & ' SquadId', ('Rating ' & IIF((`m`.`Rating` & '') IS NULL, '', (`m`.`Rating` & ''))) & ' Rating', `m`.`Id`, `m`.`CodeName`, `m`.`Rating`
5929+
SELECT ('HasSoulPatch ' & (`g`.`HasSoulPatch` & '')) & ' HasSoulPatch' AS `HasSoulPatch`, ('Rank ' & (`g`.`Rank` & '')) & ' Rank' AS `Rank`, ('SquadId ' & (`g`.`SquadId` & '')) & ' SquadId' AS `SquadId`, ('Rating ' & IIF((`m`.`Rating` & '') IS NULL, '', (`m`.`Rating` & ''))) & ' Rating' AS `Rating`, ('Timeline ' & (`m`.`Timeline` & '')) & ' Timeline' AS `Timeline`
59295930
FROM `Gears` AS `g`,
59305931
`Missions` AS `m`
59315932
ORDER BY `g`.`Nickname`, `m`.`Id`
@@ -7430,8 +7431,8 @@ public override async Task TimeSpan_Hours(bool async)
74307431
await base.TimeSpan_Hours(async);
74317432

74327433
AssertSql(
7433-
"""
7434-
SELECT DATEPART(hour, `m`.`Duration`)
7434+
"""
7435+
SELECT DATEPART('h', `m`.`Duration`)
74357436
FROM `Missions` AS `m`
74367437
""");
74377438
}
@@ -7441,8 +7442,8 @@ public override async Task TimeSpan_Minutes(bool async)
74417442
await base.TimeSpan_Minutes(async);
74427443

74437444
AssertSql(
7444-
"""
7445-
SELECT DATEPART(minute, `m`.`Duration`)
7445+
"""
7446+
SELECT DATEPART('n', `m`.`Duration`)
74467447
FROM `Missions` AS `m`
74477448
""");
74487449
}
@@ -7452,8 +7453,8 @@ public override async Task TimeSpan_Seconds(bool async)
74527453
await base.TimeSpan_Seconds(async);
74537454

74547455
AssertSql(
7455-
"""
7456-
SELECT DATEPART(second, `m`.`Duration`)
7456+
"""
7457+
SELECT DATEPART('s', `m`.`Duration`)
74577458
FROM `Missions` AS `m`
74587459
""");
74597460
}
@@ -7474,10 +7475,10 @@ public override async Task Where_TimeSpan_Hours(bool async)
74747475
await base.Where_TimeSpan_Hours(async);
74757476

74767477
AssertSql(
7477-
"""
7478-
SELECT `m`.`Id`, `m`.`BriefingDocument`, `m`.`BriefingDocumentFileExtension`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
7478+
"""
7479+
SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
74797480
FROM `Missions` AS `m`
7480-
WHERE DATEPART(hour, `m`.`Duration`) = 1
7481+
WHERE DATEPART('h', `m`.`Duration`) = 1
74817482
""");
74827483
}
74837484

@@ -7486,10 +7487,10 @@ public override async Task Where_TimeSpan_Minutes(bool async)
74867487
await base.Where_TimeSpan_Minutes(async);
74877488

74887489
AssertSql(
7489-
"""
7490-
SELECT `m`.`Id`, `m`.`BriefingDocument`, `m`.`BriefingDocumentFileExtension`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
7490+
"""
7491+
SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
74917492
FROM `Missions` AS `m`
7492-
WHERE DATEPART(minute, `m`.`Duration`) = 1
7493+
WHERE DATEPART('n', `m`.`Duration`) = 1
74937494
""");
74947495
}
74957496

@@ -7498,10 +7499,10 @@ public override async Task Where_TimeSpan_Seconds(bool async)
74987499
await base.Where_TimeSpan_Seconds(async);
74997500

75007501
AssertSql(
7501-
"""
7502-
SELECT `m`.`Id`, `m`.`BriefingDocument`, `m`.`BriefingDocumentFileExtension`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
7502+
"""
7503+
SELECT `m`.`Id`, `m`.`CodeName`, `m`.`Duration`, `m`.`Rating`, `m`.`Timeline`
75037504
FROM `Missions` AS `m`
7504-
WHERE DATEPART(second, `m`.`Duration`) = 1
7505+
WHERE DATEPART('s', `m`.`Duration`) = 1
75057506
""");
75067507
}
75077508

@@ -8775,11 +8776,11 @@ public override async Task Parameter_used_multiple_times_take_appropriate_inferr
87758776
AssertSql(
87768777
"""
87778778
@__place_0='Seattle' (Size = 255)
8778-
@__place_0='Seattle' (Size = 255)
8779+
@__place_0_1='Seattle' (Size = 100)
87798780
87808781
SELECT `c`.`Name`, `c`.`Location`, `c`.`Nation`
87818782
FROM `Cities` AS `c`
8782-
WHERE `c`.`Nation` = @__place_0 OR `c`.`Location` = @__place_0
8783+
WHERE `c`.`Nation` = @__place_0 OR `c`.`Location` = @__place_0_1
87838784
""");
87848785
}
87858786

0 commit comments

Comments
 (0)