Skip to content

Commit

Permalink
dont forget to set total.
Browse files Browse the repository at this point in the history
  • Loading branch information
Meissner Stephan (DCCS) committed Sep 17, 2019
1 parent f477a1f commit 79f907f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DCCS.Data.Source.Tests/ResultTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public void Should_bootstrap_from_provided_data()
{
var data = new Faker<Dummy>().Generate(13);
var ps = new Params { Count = 10, Page = 1 };
var sut = new Result<Dummy>(ps, data.AsEnumerable());
var sut = new Result<Dummy>(ps, data.AsEnumerable(), 99);

Assert.AreEqual(sut.Count, data.Count());
Assert.AreEqual(sut.Desc, ps.Desc);
Assert.AreEqual(sut.OrderBy, ps.OrderBy);
Assert.AreEqual(sut.Page, ps.Page);
Assert.AreEqual(sut.Total, 0);
Assert.AreEqual(sut.Total, 99);
}
}
}
5 changes: 4 additions & 1 deletion DCCS.Data.Source/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public Result(Params ps, IQueryable<T> data = null) : base(ps, data)
{
}

public Result(Params ps, IEnumerable<T> data) : base(ps, data) { }
public Result(Params ps, IEnumerable<T> data, int total) : base(ps, data)
{
Total = total;
}

public override void SetData(IQueryable<T> data)
{
Expand Down

0 comments on commit 79f907f

Please sign in to comment.