Skip to content

Commit c3eacb0

Browse files
committed
more tests
1 parent 6268ed9 commit c3eacb0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

Eocron.Algorithms.Tests/PagingQueryableTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class PagingQueryableTests
1515
[SetUp]
1616
public void Setup()
1717
{
18-
var now = DateTime.UtcNow;
18+
var now = new DateTime(2017, 12, 1);
1919
_items = new List<TestDbEntity>()
2020
{
2121
new TestDbEntity(){Id = Guid.Parse("10000000-0000-0000-0000-000000000001"),Name = "Test1", Modified = now.AddDays(1)},
@@ -37,10 +37,12 @@ public void SanityCheck()
3737
cfg.AddKeySelector(x=> x.Id);
3838

3939
var result = new List<TestDbEntity>();
40+
var queries = new List<string>();
4041
string ct = null;
4142
do
4243
{
4344
var tmpQuery = queryable.ApplyContinuationTokenFilter(cfg, ct);
45+
queries.Add(tmpQuery.ToString());
4446
var tmp = tmpQuery.Take(1).ToList().FirstOrDefault();
4547
if (tmp != null)
4648
{
@@ -54,6 +56,15 @@ public void SanityCheck()
5456
} while (ct != null);
5557

5658
result.Should().Equal(_items.OrderByDescending(x=> x.Modified).ThenBy(x=> x.Id));
59+
queries.Should().Equal([
60+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id)",
61+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/7/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000006)) OrElse (x.Modified < 12/7/2017 12:00:00 AM)))",
62+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/6/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000005)) OrElse (x.Modified < 12/6/2017 12:00:00 AM)))",
63+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/5/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000004)) OrElse (x.Modified < 12/5/2017 12:00:00 AM)))",
64+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/4/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000003)) OrElse (x.Modified < 12/4/2017 12:00:00 AM)))",
65+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/3/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000002)) OrElse (x.Modified < 12/3/2017 12:00:00 AM)))",
66+
"System.Collections.Generic.List`1[Eocron.Algorithms.Tests.PagingQueryableTests+TestDbEntity].OrderByDescending(x => x.Modified).ThenBy(x => x.Id).Where(x => (((x.Modified == 12/2/2017 12:00:00 AM) AndAlso (x.Id > 10000000-0000-0000-0000-000000000001)) OrElse (x.Modified < 12/2/2017 12:00:00 AM)))"
67+
]);
5768
}
5869

5970
public class TestDbEntity

0 commit comments

Comments
 (0)