public void RenderTheIndexView()
            {
                var controller = new RehearsalsController();

                var result = controller.Index();

                result.AssertViewRendered().ForView("Index").WithViewData<IEnumerable<Rehearsal>>();
            }
            public void RenderTheDetailsView()
            {
                var controller = new RehearsalsController();

                var result = controller.Details(1);

                result.AssertViewRendered().ForView("Details").WithViewData<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));
            }
            public void DisplayTheRehearsalRequested()
            {
                var controller = new RehearsalsController();

                var result = controller.Details(1) as ViewResult;
                var rehearsal = result.Model as Rehearsal;

                Assert.That(rehearsal.Id, Is.EqualTo(1));
            }