public void Index_Should_Return_A_View() { // Arrange var controller = new ToDoController(_session); // Act var result = (ViewResult)controller.Index(); // Assert Assert.IsInstanceOf(typeof(ViewResult), result); }
public void Index_Message_Should_Be_Correct() { // Arrange var controller = new ToDoController(_session); // Act var result = (ViewResult)controller.Index(); // Assert Assert.AreEqual(result.ViewBag.Message, "Welcome to YaToDo - A Massive Sample!"); }
public void Index_Should_Return_Four_ToDoLists() { // Arrange var controller = new ToDoController(_session); // Act var result = (ViewResult)controller.Index(); dynamic resultModel = (dynamic)result.Model; // Assert Assert.AreEqual(4, resultModel.Count); }