forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntitiesTests.Include.cs
More file actions
32 lines (28 loc) · 842 Bytes
/
EntitiesTests.Include.cs
File metadata and controls
32 lines (28 loc) · 842 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
using System.Collections;
using System.Linq.Dynamic.Core.Tests.Helpers.Entities;
#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/StefH/System.Linq.Dynamic.Core/issues/28
/// </summary>
[Fact]
public void Entities_Where_Include()
{
// Arrange
PopulateTestData(5, 2);
var expected = _context.Blogs.Include(b => b.Posts).Where(b => b.BlogId > 2000).ToArray();
// Act
var test = _context.Blogs.Include(b => b.Posts).Where("BlogId > 2000").ToArray();
// Assert
Assert.Equal(expected, test);
}
}
}