Skip to content

Commit

Permalink
Query: Add regression tests
Browse files Browse the repository at this point in the history
Issue #6203
  • Loading branch information
smitpatel committed Nov 22, 2019
1 parent 88bd694 commit 26930bb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5559,5 +5559,14 @@ public virtual Task OrderBy_collection_count_ThenBy_reference_navigation(bool as
() => l1.OneToOne_Required_FK1.OneToOne_Required_FK2.Name)),
assertOrder: true);
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Null_conditional_is_not_applied_explicitly_for_optional_navigation(bool async)
{
return AssertQuery(
async,
ss => ss.Set<Level1>().Where(l1 => l1.OneToOne_Optional_FK1 != null && l1.OneToOne_Optional_FK1.Name == "L2 01"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4301,6 +4301,17 @@ FROM [LevelThree] AS [l2]
WHERE [l0].[Id] IS NOT NULL AND ([l0].[Id] = [l2].[OneToMany_Required_Inverse3Id])), [l1].[Name]");
}

public override async Task Null_conditional_is_not_applied_explicitly_for_optional_navigation(bool async)
{
await base.Null_conditional_is_not_applied_explicitly_for_optional_navigation(async);

AssertSql(
@"SELECT [l].[Id], [l].[Date], [l].[Name], [l].[OneToMany_Optional_Self_Inverse1Id], [l].[OneToMany_Required_Self_Inverse1Id], [l].[OneToOne_Optional_Self1Id]
FROM [LevelOne] AS [l]
LEFT JOIN [LevelTwo] AS [l0] ON [l].[Id] = [l0].[Level1_Optional_Id]
WHERE [l0].[Id] IS NOT NULL AND ([l0].[Name] = N'L2 01')");
}

private void AssertSql(params string[] expected) => Fixture.TestSqlLoggerFactory.AssertBaseline(expected);
}
}

0 comments on commit 26930bb

Please sign in to comment.