public void Index_ReturnsAllLunchesInDescendingOrder() { // Arrange var Lunches = new List <Lunch> { new Lunch { Host = "Brent", Restaurants = new List <Restaurant> { new Restaurant { Name = "Lunchbox Labs", Latitude = 55, Longitude = 99 } }, MeetingTime = new DateTime(1999, 12, 31) }, new Lunch { Host = "Drew", Restaurants = new List <Restaurant> { new Restaurant { Name = "The Pine Box", Latitude = 55, Longitude = 99 } }, MeetingTime = new DateTime(2005, 12, 31) }, }; _context.Lunches.AddRange(Lunches); _context.SaveChanges(); var controller = new LunchesController(_context); // Act var result = controller.Index() as ViewResult; // Assert var data = result.Model as IEnumerable <LunchDetailsViewModel>; data.ShouldNotBeNull(); data.Count().ShouldBe(2); data.First().Host.ShouldBe("Drew"); data.Last().Host.ShouldBe("Brent"); data.First().MeetingTimeDisplay.ShouldBe("12:00 AM Saturday, December 31, 2005"); data.Last().MeetingTimeDisplay.ShouldBe("12:00 AM Friday, December 31, 1999"); }