Update all test assertions for EF Core 10 parameter naming changes#121
Merged
renemadsen merged 4 commits intomasterfrom Nov 17, 2025
Merged
Update all test assertions for EF Core 10 parameter naming changes#121renemadsen merged 4 commits intomasterfrom
renemadsen merged 4 commits intomasterfrom
Conversation
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Assert.Equal() failure for string comparison
Fix test assertions for EF Core 10 parameter naming changes
Nov 17, 2025
Member
|
@copilot since we have the same kind of error, it must be safe to assume that all parameters have been changed from being without leading __ and trailing number in ef .net core 10 |
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
Author
... You're absolutely right! I've now updated all 690 parameter references across 34 test files systematically. The changes follow the EF Core 10 pattern of removing the The fix is in commit 5ad8288 which updates parameters like:
|
Copilot
AI
changed the title
Fix test assertions for EF Core 10 parameter naming changes
Update all test assertions for EF Core 10 parameter naming changes
Nov 17, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EF Core 10 removed
@__prefixes and_Nsuffixes from SQL parameter names. This PR systematically updates all test assertions to match the new parameter naming convention.Changes
Comprehensive Update (35 test files, 701 parameter references):
@__variableName_Nwith@variableNameIndexof_with_emptystring: corrected SQL assertion fromRegiontoContactName(unrelated bug)Key files updated:
Examples:
Technical Details
EF Core 10 Parameter Naming Changes:
@__variableName_0,@__variableName_1@variableNameRef: dotnet/efcore#35113
Validation
Fixes #120
Original prompt
This section details on the original issue you should resolve
<issue_title>Assert.Equal() Failure: Strings differ</issue_title>
<issue_description>```
Error: Assert.Equal() Failure: Strings differ
↓ (pos 227)
Expected: ···"\nWHERE (LOCATE('',
c.`Region`) - 1) = 0"Actual: ···"RE (LOCATE('', `c`.`ContactName`) - 1) = "···
↑ (pos 227)
[xUnit.net 00:00:18.82] Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.DateDiffDay(isAsync: False) [FAIL]
Failed Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.NorthwindFunctionsQueryMySqlTest.Indexof_with_emptystring(async: False) [192 ms]
Error Message:
Assert.Equal() Failure: Strings differ
↓ (pos 227)
Expected: ···"\nWHERE (LOCATE('',
c.Region) - 1) = 0"Actual: ···"RE (LOCATE('',
c.ContactName) - 1) = "···↑ (pos 227)
Stack Trace:
at Microsoft.EntityFrameworkCore.TestUtilities.TestSqlLoggerFactory.AssertBaseline(String[] expected, Boolean assertOrder, Boolean forUpdate)
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.NorthwindFunctionsQueryMySqlTest.AssertSql(String[] expected) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/NorthwindFunctionsQueryMySqlTest.cs:line 3315
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.NorthwindFunctionsQueryMySqlTest.Indexof_with_emptystring(Boolean async) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/NorthwindFunctionsQueryMySqlTest.cs:line 236
--- End of stack trace from previous location ---
Error: Assert.Equal() Failure: Strings differ
↓ (pos 1)
Expected: "@__matchExpireDateTime_0='2299-12-31T00:0"···
Actual: "@matchExpireDateTime='2299-12-31T00:00:00"···
↑ (pos 1)
Failed Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.ToDateTime_with_default_TimeOnly(isAsync: False) [110 ms]
Error Message:
Assert.Equal() Failure: Strings differ
↓ (pos 1)
Expected: "@__matchExpireDateTime_0='2299-12-31T00:0"···
Actual: "@matchExpireDateTime='2299-12-31T00:00:00"···
↑ (pos 1)
Stack Trace:
at Microsoft.EntityFrameworkCore.TestUtilities.TestSqlLoggerFactory.AssertBaseline(String[] expected, Boolean assertOrder, Boolean forUpdate)
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.AssertSql(String expected) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/DateOnlyQueryMySqlTest.cs:line 162
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.ToDateTime_with_default_TimeOnly(Boolean isAsync) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/DateOnlyQueryMySqlTest.cs:line 96
--- End of stack trace from previous location ---
Passed Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.NullKeysMySqlTest.Include_with_null_fKs_and_non_nullable_PK [150 ms]
Passed Pomelo.EntityFrameworkCore.MySql.FunctionalTests.ModelBuilding.MySqlModelBuilderGenericTest+MySqlGenericOneToOne.Inverse_discovered_after_entity_unignored [161 ms]
Error: Assert.Equal() Failure: Strings differ
↓ (pos 1)
Expected: "@__todayDateOnly_1='11/17/2025' (DbType ="···
Actual: "@todayDateOnly='11/17/2025' (DbType = Dat"···
↑ (pos 1)
Failed Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.DateDiffDay(isAsync: True) [74 ms]
Error Message:
Assert.Equal() Failure: Strings differ
↓ (pos 1)
Expected: "@__todayDateOnly_1='11/17/2025' (DbType ="···
Actual: "@todayDateOnly='11/17/2025' (DbType = Dat"···
↑ (pos 1)
Stack Trace:
at Microsoft.EntityFrameworkCore.TestUtilities.TestSqlLoggerFactory.AssertBaseline(String[] expected, Boolean assertOrder, Boolean forUpdate)
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.AssertSql(String expected) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/DateOnlyQueryMySqlTest.cs:line 162
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.DateDiffDay(Boolean isAsync) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/DateOnlyQueryMySqlTest.cs:line 134
at Pomelo.EntityFrameworkCore.MySql.FunctionalTests.Query.DateOnlyQueryMySqlTest.DateDiffDay(Boolean isAsync) in /home/runner/work/Pomelo.EntityFrameworkCore.MySql/Pomelo.EntityFrameworkCore.MySql/test/EFCore.MySql.FunctionalTests/Query/DateOnlyQueryMySqlTest.cs:line 134