public void CountOfDataReader(int firstResult, int maxResults) { const string SQL = "CustOrderHist"; int totalCount; int maxCount; using (var reader = NorthwindAdoRepository.ExecuteReader(SQL, CustomerTestParameter)) totalCount = reader.Count(); using (var reader = NorthwindAdoRepository.ExecuteReader(SQL, CustomerTestParameter)) { var histories = reader.Map <CustomerOrderHistory>(TrimMapper, firstResult, maxResults); maxCount = histories.Count; } Assert.IsTrue(totalCount >= maxCount); }