Skip to content

Commit

Permalink
Fix tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Danevandy99 committed May 27, 2024
1 parent 5333cd5 commit 9f353a0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ namespace Microsoft.EntityFrameworkCore.Query.Internal;
/// </summary>
public class EnumMethodTranslator : IMethodCallTranslator
{
<<<<<<<< HEAD:src/EFCore.Relational/Query/Internal/Translators/EnumHasFlagTranslator.cs
private static readonly MethodInfo MethodInfo
= typeof(Enum).GetRuntimeMethod(nameof(Enum.HasFlag), [typeof(Enum)])!;
========
private static readonly MethodInfo HasFlagMethodInfo
= typeof(Enum).GetRuntimeMethod(nameof(Enum.HasFlag), new[] { typeof(Enum) })!;
>>>>>>>> f0449af231 (Applying requested changes):src/EFCore.Relational/Query/Internal/EnumMethodTranslator.cs

private static readonly MethodInfo ToStringMethodInfo
= typeof(object).GetRuntimeMethod(nameof(ToString), new Type[] { })!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public RelationalMethodCallTranslatorProvider(RelationalMethodCallTranslatorProv
new CollateTranslator(),
new ContainsTranslator(sqlExpressionFactory),
new LikeTranslator(sqlExpressionFactory),
new EnumHasFlagTranslator(sqlExpressionFactory),
new EnumMethodTranslator(sqlExpressionFactory),
new GetValueOrDefaultTranslator(sqlExpressionFactory),
new ComparisonTranslator(sqlExpressionFactory),
new ByteArraySequenceEqualTranslator(sqlExpressionFactory),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9350,7 +9350,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_property(bool

AssertSql(
"""
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) < [m].[Time]
""");
Expand All @@ -9364,7 +9364,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_parameter(boo
"""
@__time_0='01:02' (DbType = Time)

SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) = @__time_0
""");
Expand All @@ -9376,7 +9376,7 @@ public override async Task Order_by_TimeOnly_FromTimeSpan(bool async)

AssertSql(
"""
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
ORDER BY CAST([m].[Duration] AS time)
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5390,15 +5390,15 @@ public override async Task ToString_enum_property_projection(bool async)
AssertSql(
"""
SELECT CASE
WHEN [t].[Rank] = 0 THEN N'None'
WHEN [t].[Rank] = 1 THEN N'Private'
WHEN [t].[Rank] = 2 THEN N'Corporal'
WHEN [t].[Rank] = 4 THEN N'Sergeant'
WHEN [t].[Rank] = 8 THEN N'Lieutenant'
WHEN [t].[Rank] = 16 THEN N'Captain'
WHEN [t].[Rank] = 32 THEN N'Major'
WHEN [t].[Rank] = 64 THEN N'Colonel'
WHEN [t].[Rank] = 128 THEN N'General'
WHEN [u].[Rank] = 0 THEN N'None'
WHEN [u].[Rank] = 1 THEN N'Private'
WHEN [u].[Rank] = 2 THEN N'Corporal'
WHEN [u].[Rank] = 4 THEN N'Sergeant'
WHEN [u].[Rank] = 8 THEN N'Lieutenant'
WHEN [u].[Rank] = 16 THEN N'Captain'
WHEN [u].[Rank] = 32 THEN N'Major'
WHEN [u].[Rank] = 64 THEN N'Colonel'
WHEN [u].[Rank] = 128 THEN N'General'
ELSE N''
END
FROM (
Expand All @@ -5407,7 +5407,7 @@ FROM [Gears] AS [g]
UNION ALL
SELECT [o].[Rank]
FROM [Officers] AS [o]
) AS [t]
) AS [u]
""");
}

Expand Down Expand Up @@ -11957,7 +11957,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_property(bool

AssertSql(
"""
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) < [m].[Time]
""");
Expand All @@ -11971,7 +11971,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_parameter(boo
"""
@__time_0='01:02' (DbType = Time)

SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) = @__time_0
""");
Expand All @@ -11983,7 +11983,7 @@ public override async Task Order_by_TimeOnly_FromTimeSpan(bool async)

AssertSql(
"""
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
ORDER BY CAST([m].[Duration] AS time)
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10181,7 +10181,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_property(bool

AssertSql(
"""
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) < [m].[Time]
""");
Expand All @@ -10195,7 +10195,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_parameter(boo
"""
@__time_0='01:02' (DbType = Time)

SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
WHERE CAST([m].[Duration] AS time) = @__time_0
""");
Expand All @@ -10207,7 +10207,7 @@ public override async Task Order_by_TimeOnly_FromTimeSpan(bool async)

AssertSql(
"""
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] AS [m]
ORDER BY CAST([m].[Duration] AS time)
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_property(bool

AssertSql(
"""
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m]
WHERE CAST([m].[Duration] AS time) < [m].[Time]
""");
Expand All @@ -491,7 +491,7 @@ public override async Task Where_TimeOnly_FromTimeSpan_compared_to_parameter(boo
"""
@__time_0='01:02' (DbType = Time)

SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m]
WHERE CAST([m].[Duration] AS time) = @__time_0
""");
Expand All @@ -503,7 +503,7 @@ public override async Task Order_by_TimeOnly_FromTimeSpan(bool async)

AssertSql(
"""
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
SELECT [m].[Id], [m].[BriefingDocument], [m].[BriefingDocumentFileExtension], [m].[CodeName], [m].[Date], [m].[Difficulty], [m].[Duration], [m].[PeriodEnd], [m].[PeriodStart], [m].[Rating], [m].[Time], [m].[Timeline]
FROM [Missions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [m]
ORDER BY CAST([m].[Duration] AS time)
""");
Expand Down

0 comments on commit 9f353a0

Please sign in to comment.