public void All_ShouldReturnValidTelescopes() { // Arrange StarStuffDbContext db = this.Database; TelescopeService telescopeService = new TelescopeService(db); this.SeedDatabase(db); const int page = 2; const int pageSize = 5; List <Telescope> fakeTelescopes = this.GetFakeTelescopes() .OrderBy(t => t.MirrorDiameter) .Skip((page - 1) * pageSize) .Take(pageSize) .ToList(); int i = -1; // Act IEnumerable <ListTelescopesServiceModel> telescopes = telescopeService.All(page, pageSize); // Assert foreach (var actual in telescopes) { Telescope expected = fakeTelescopes[++i]; this.CompareTelescopes(expected, actual); } }