Skip to content

Commit

Permalink
Added a test to showcase parameter duplication + some strange SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
austindrenski committed May 17, 2018
1 parent 9dbc029 commit 5394545
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ public void NpgsqlInetDoesNotContainOrEqualNpgsqlInet()
}
}

/// <summary>
/// Tests inverse translation for <see cref="NpgsqlNetworkAddressExtensions.Contains(NpgsqlInet,NpgsqlInet)"/>.
/// </summary>
[Fact]
public void Demonstrate_ValueTypeParametersAreDuplicated()
{
using (NetContext context = Fixture.CreateContext())
{
NpgsqlInet npgsqlInet = new IPAddress(0);

bool[] _ =
context.NetTestEntities
.Where(x => x.CidrMappedToNpgsqlInet.ContainsOrEquals(npgsqlInet))
.Select(x => x.CidrMappedToNpgsqlInet.Equals(npgsqlInet))
.ToArray();

AssertContainsSql("SELECT x.\"CidrMappedToNpgsqlInet\" = @__npgsqlInet_0");
AssertContainsSql("WHERE x.\"CidrMappedToNpgsqlInet\" >>= @__npgsqlInet_0");
}
}

#endregion

#region Fixtures
Expand Down

0 comments on commit 5394545

Please sign in to comment.