forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntitiesTests.In.cs
More file actions
36 lines (31 loc) · 995 Bytes
/
Copy pathEntitiesTests.In.cs
File metadata and controls
36 lines (31 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#if EFCORE
using Microsoft.EntityFrameworkCore;
#else
using System.Data.Entity;
#endif
using Xunit;
namespace System.Linq.Dynamic.Core.Tests
{
public partial class EntitiesTests : IDisposable
{
/// <summary>
/// Test for https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/524
/// </summary>
#if EFCORE
[Fact(Skip = "Fails on .NET Core App with EF Core ?")]
#else
[Fact]
#endif
public void Entities_Where_In_And()
{
// Arrange
PopulateTestData();
var expected = _context.Blogs.Include(b => b.Posts).Where(b => new[] { 1, 3, 5 }.Contains(b.BlogId) && new[] { "Blog3", "Blog4" }.Contains(b.Name)).ToArray();
// Act
var test = _context.Blogs.Include(b => b.Posts).Where(@"BlogId in (1, 3, 5) and Name in (""Blog3"", ""Blog4"")").ToArray();
// Assert
Assert.NotEmpty(test);
Assert.Equal(expected, test);
}
}
}