forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QueryIdGreaterThan.cs
44 lines (41 loc) · 962 Bytes
/
QueryIdGreaterThan.cs
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
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
namespace Raven.Tests.Bugs
{
public class QueryIdGreaterThan : RavenTest
{
[Fact]
public void CanQueryForIdGreaterThan()
{
using (var store = NewDocumentStore())
{
using (var s = store.OpenSession())
{
s.Store(new UserInt32 {
Id = 1,
Name = "Ayende"
});
s.Store(new UserInt32 {
Id = 2,
Name = "Itamar"
});
s.Store(new UserInt32 {
Id = 3,
Name = "Chris"
});
s.SaveChanges();
}
using (var s = store.OpenSession())
{
var test1 = s.Query<UserInt32>().Customize(d => d.WaitForNonStaleResults()).Where(x => x.Id == 1 && x.Name == "Ayende").ToList();
var test2 = s.Query<UserInt32>().Customize(d => d.WaitForNonStaleResults()).Where(x => x.Id >= 1).ToList();
Assert.Equal(1, test1.Count);
Assert.Equal(3, test2.Count);
}
}
}
}
}