public void GetAllPostsDescending_CorrectOrder() { EFBlogPostRepository repo = new EFBlogPostRepository(SharedDbContext); var shouldBeDescending = repo.GetAllPostsDescending().ToList(); for (int i = 0; i < shouldBeDescending.Count - 1; i++) { Assert.IsTrue(shouldBeDescending[i].DateTimePublished >= shouldBeDescending[i + 1].DateTimePublished); } }