Skip to content

Commit 4467b5a

Browse files
Copilotrenemadsen
andcommitted
Fix nullable UInt64 enum test method signature
Removed unnecessary 'new' keyword and corrected parameter type from EnumU64 to EnumU64? (nullable) to match the actual test requirements for nullable enum values. The fix: 1. Changed parameter type from EnumU64 to EnumU64? to match nullable enum semantics 2. Removed 'new' keyword since no base method exists with this exact signature 3. Updated condition to check value.HasValue before casting to handle null case Build now succeeds with zero compilation errors. Co-authored-by: renemadsen <[email protected]>
1 parent 97f7387 commit 4467b5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/EFCore.MySql.FunctionalTests/Query/JsonTypesRelationalMySqlTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public override Task Can_read_write_collection_of_ulong_enum_JSON_values()
8585
[InlineData(EnumU64.One, """{"Prop":1}""")]
8686
[InlineData((EnumU64)8, """{"Prop":8}""")]
8787
[InlineData((EnumU64)18446744073709551615, """{"Prop":-1}""")] // UInt64.MaxValue as numeric literal - will be adjusted for MariaDB at runtime
88-
public new async Task Can_read_write_nullable_ulong_enum_JSON_values(EnumU64 value, string json)
88+
public async Task Can_read_write_nullable_ulong_enum_JSON_values(EnumU64? value, string json)
8989
{
9090
// MariaDB serializes UInt64.MaxValue as "18446744073709551615" instead of "-1"
9191
// Adjust the expected JSON value for MariaDB to match its actual behavior
9292
// Check for both EnumU64.Max and the numeric literal (both represent UInt64.MaxValue)
93-
if (AppConfig.ServerVersion.Type == ServerType.MariaDb && (ulong)value == 18446744073709551615)
93+
if (AppConfig.ServerVersion.Type == ServerType.MariaDb && value.HasValue && (ulong)value.Value == 18446744073709551615)
9494
{
9595
json = """{"Prop":18446744073709551615}""";
9696
}

0 commit comments

Comments
 (0)