Skip to content

Commit

Permalink
extra test for Select() + paging + value type
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Oct 29, 2024
1 parent 2369d37 commit b45e3be
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/ValueTypeTests/linq_querying_with_value_types.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Marten;
using Marten.Linq;
using Marten.Pagination;
using Marten.Testing.Harness;
using Vogen;

Expand Down Expand Up @@ -73,6 +74,27 @@ public async Task store_several_and_query_by()
ordered.ShouldHaveTheSameElementsAs(doc4.Id);
}

[Fact]
public async Task store_several_and_query_by_with_paging()
{
var doc1 = new LimitedDoc { Lower = LowerLimit.From(1), Upper = UpperLimit.From(20) };
var doc2 = new LimitedDoc { Lower = LowerLimit.From(5), Upper = UpperLimit.From(25) };
var doc3 = new LimitedDoc { Lower = LowerLimit.From(4), Upper = UpperLimit.From(15) };
var doc4 = new LimitedDoc { Lower = LowerLimit.From(3), Upper = UpperLimit.From(10) };

theSession.Store(doc1, doc2, doc3, doc4);
await theSession.SaveChangesAsync();

var ordered = await theSession
.Query<LimitedDoc>()
.OrderBy(x => x.Lower)
.Where(x => x.Upper == UpperLimit.From(10))
.Select(x => x.Id)
.ToPagedListAsync(1, 10);

ordered.ShouldHaveTheSameElementsAs(doc4.Id);
}

[Fact]
public async Task use_value_type_as_parameter_in_compiled_query()
{
Expand Down

0 comments on commit b45e3be

Please sign in to comment.