public void RenderTheIndexView() { var controller = new RehearsalsController(); var result = controller.Index(); result.AssertViewRendered().ForView("Index").WithViewData<IEnumerable<Rehearsal>>(); }
public void DisplayTheRehearsalsInAscendingOrderByDate() { var controller = new RehearsalsController(); var result = controller.Index() as ViewResult; var rehearsals = result.Model as IEnumerable<Rehearsal>; Assert.That(rehearsals.OrderBy(r => r.DateAndStartTime), Is.EqualTo(rehearsals)); }
public void DisplayOnlyRehearsalsThatTakePlaceInTheFuture() { var controller = new RehearsalsController(); var result = controller.Index() as ViewResult; var rehearsals = result.Model as IEnumerable<Rehearsal>; Assert.That(rehearsals.All(r => r.DateAndStartTime > DateTime.Now)); }