Skip to content

Commit

Permalink
adding passing linq orderby test
Browse files Browse the repository at this point in the history
  • Loading branch information
fschwiet committed Sep 6, 2010
1 parent 8515240 commit 013c245
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Raven.Client.Tests/Bugs/SortingOnLong.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void UsingDatabaseOfFoos(Action<IDocumentSession> action)
new IndexDefinition
{
Map = "from doc in docs select new { doc.Value }",
SortOptions = { { "Value", SortOptions.Long } }
SortOptions = { { "Value", SortOptions.Long } },
});

using (var session = store.OpenSession())
Expand Down Expand Up @@ -63,6 +63,24 @@ public void CanSortOnLong()
});
}

[Fact]
public void CanLinqSortOnLong()
{
UsingDatabaseOfFoos(delegate(IDocumentSession session)
{
var foos1 = session.Query<Foo>("long")
.Customize(q => q.WaitForNonStaleResults())
.OrderBy(f => f.Value)
.ToList();

Assert.Equal(3, foos1.Count);

Assert.Equal(25, foos1[0].Value);
Assert.Equal(3147483647, foos1[1].Value);
Assert.Equal(30000000000, foos1[2].Value);
});
}

[Fact(Skip = "Fails with foos1[0]==25, not 30000000000")]
public void CanSortOnLongDescending()
{
Expand Down

0 comments on commit 013c245

Please sign in to comment.