public async Task FindOlderThanAsync_ReturnsEmptySetWhenNoOlders() { await FeedTestData(_context, 20); var service = new UrlService(_context); var actual = await service.FindOlderThanAsync(DateTimeOffset.UtcNow.AddMinutes(-5)); Assert.Empty(actual); }
public async Task FindOlderThanAsync_ReturnsOlderThanGivenOffset() { const int expectedCount = 10; await FeedTestData(_context, expectedCount); var service = new UrlService(_context); var actual = await service.FindOlderThanAsync(DateTimeOffset.UtcNow); Assert.NotEmpty(actual); Assert.Equal(expectedCount, actual.Count()); Assert.DoesNotContain(actual, url => url == null); }