Skip to content

Commit

Permalink
add regression test for #16955
Browse files Browse the repository at this point in the history
  • Loading branch information
maumar committed Nov 5, 2019
1 parent 7abc752 commit 7ce6d37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,12 @@ public virtual void IsNull_on_complex_expression()
}
}

[ConditionalFact]
public virtual void Coalesce_not_equal()
{
AssertQuery<NullSemanticsEntity1>(es => es.Where(e => (e.NullableIntA ?? 0) != 0));
}

protected static TResult Maybe<TResult>(object caller, Func<TResult> expression)
where TResult : class
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,16 @@ FROM [Entities1] AS [e]
WHERE [e].[NullableIntA] IS NOT NULL OR [e].[NullableIntB] IS NOT NULL");
}

public override void Coalesce_not_equal()
{
base.Coalesce_not_equal();

AssertSql(
@"SELECT [e].[Id]
FROM [Entities1] AS [e]
WHERE COALESCE([e].[NullableIntA], 0) <> 0");
}

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

Expand Down

0 comments on commit 7ce6d37

Please sign in to comment.