public void TotalTest() { QueryResponse target = new QueryResponse(); int expected = 0; Assert.AreEqual(expected, target.Total); }
public void QueryResponseConstructorTest() { QueryResponse target = new QueryResponse(); Assert.IsNotNull(target); }
public void SubjectsTest() { QueryResponse target = new QueryResponse(); List<TestSubject> expected = null; Assert.AreEqual(expected, target.Subjects); }
/// <summary> /// See <see cref="IDataStore"/> for method descriptions. /// </summary> public QueryResponse GetData(PageOptions paging) { QueryResponse response = new QueryResponse(); IEnumerable<TestSubject> results = new List<TestSubject>(); if (paging == null) { paging = new PageOptions(); } if (paging.SortBy == PageOptions.Sort.FirstName) results = datastore.OrderBy(e => e.FirstName); else if (paging.SortBy == PageOptions.Sort.LastName) results = datastore.OrderBy(e => e.LastName); else if (paging.SortBy == PageOptions.Sort.Email) results = datastore.OrderBy(e => e.Email); else if (paging.SortBy == PageOptions.Sort.Password) results = datastore.OrderBy(e => e.Password); response.Subjects = results.Skip(paging.PageNumber * 5).Take(5).ToList(); response.Total = datastore.Count; return response; }