public void DisplayTheIndexView() { var controller = new ConcertsController(); var result = controller.Index(); result.AssertViewRendered().ForView("Index").WithViewData<IEnumerable<Concert>>(); }
public void DisplayTheConcertsInDescendingOrderByDate() { var controller = new ConcertsController(); var result = controller.Index() as ViewResult; var concerts = result.Model as IEnumerable<Concert>; Assert.That(concerts.OrderByDescending(c => c.DateAndStartTime), Is.EqualTo(concerts)); }