public void Home_ViewResult_Should_Have_The_Right_Title () { string intendedTitle = "Squarker | Home"; var pagesController = new PagesController(); var result = pagesController.Home() as ViewResult; string actualTitle = ApplicationHelper.RenderTitle(result.ViewData); Assert.AreEqual(intendedTitle, actualTitle, "Home page title was incorrect"); }
public void Home_Action_Should_Return_Home_View() { //Arrange var pagesController = new PagesController(); //Act var result = pagesController.Home() as ViewResult; //Assert Assert.IsNotNull(result, "Should have returned a ViewResult"); Assert.AreEqual("Home", result.ViewName, "View should have been Home"); }