public void Index_RendersView() { var controller = new GuestbookController( new FakeGuestbookRepository()); var result = controller.Index() as ViewResult; Assert.IsNotNull(result); }
public void Index_gets_most_recent_entries() { var controller = new GuestbookController( new FakeGuestbookRepository()); var result = (ViewResult)controller.Index(); var guestbookEntries = (IList <GuestbookEntry>)result.Model; Assert.AreEqual(1, guestbookEntries.Count); }