public void About() { // Arrange var mockRepo = MockRepository.GenerateMock<IRepository>(); HomeController controller = new HomeController(mockRepo); // Act ViewResult result = controller.About() as ViewResult; // Assert Assert.IsNotNull(result); }
public void Index() { // Arrange var mockRepo = MockRepository.GenerateMock<IRepository>(); HomeController controller = new HomeController(mockRepo); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.AreEqual("Welcome to ASP.NET MVC!", result.ViewBag.Message); }