Exemple #1
0
        public AthleteHealthQuery GetHealthHistory(AthleteHealthQuery query)
        {
            var healths = DataContext.Queryable<AthleteHealth>().Where(x => x.Athlete.Equals(query.Athlete));
            var pager = new Pager<AthleteHealth>(
                healths,
                query.PagingData.PageOffset,
                query.PagingData.PageSize,
                query.PagingData.RequestsLastPage);

            query.AthleteHealthHistory = pager.GetPagedItems().ToList();
            query.PagingData.TotalCount = pager.TotalCount;
            query.PagingData.PageOffset = pager.PageOffset;
            return query;
        }
        public void AssertFindsHistory()
        {
            const int pagesize = 5;
            var athleteBuilder = new AthleteBuilder();
            var athlete = athleteBuilder.Build();
            var query =
                new AthleteHealthQuery {PagingData = BuildPagingData(pagesize), Athlete = athlete};
            MemoryDataContext.Clear();

            MemoryDataContext.Add(athlete);
            InsertTestHealthHistory(athlete, pagesize*2);

            var athleteDataAccess = new AthleteDataAccess();

            query = athleteDataAccess.GetHealthHistory(query);

            Assert.AreEqual(pagesize, query.AthleteHealthHistory.Count);
            Assert.AreEqual(pagesize*2, query.PagingData.TotalCount);
        }
Exemple #3
0
 public void SetAthleteHealthQuery(AthleteHealthQuery query)
 {
     throw new NotImplementedException();
 }