forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWhereClauseTest.cs
51 lines (44 loc) · 1.43 KB
/
WhereClauseTest.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
45
46
47
48
49
50
51
// -----------------------------------------------------------------------
// <copyright file="WhereClauseTest.cs" company="Hibernating Rhinos LTD">
// Copyright (c) Hibernating Rhinos LTD. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------
using System.Linq;
using Raven.Client;
using Raven.Tests.Common;
using Xunit;
namespace Raven.Tests.MailingList
{
public class WhereClauseTest : RavenTest
{
[Fact]
public void ATest()
{
using (var ds = NewDocumentStore())
{
using (IDocumentSession session = ds.OpenSession())
{
session.Store(new TestEntity(int.MaxValue));
session.SaveChanges();
}
using (IDocumentSession qSession = ds.OpenSession())
{
var entities = qSession.Query<TestEntity>()
.Customize(x=>x.WaitForNonStaleResults())
.Where(x => x.IntType > 0)
.ToList();
Assert.True(entities.Count > 0);
}
}
}
public class TestEntity
{
public TestEntity(int intValue)
{
IntType = intValue;
}
public string Id { get; set; }
public int IntType { get; set; }
}
}
}