public void MaintTaskControllerEnsureIndexViewExists() { // Arrange MaintTaskController controller = new MaintTaskController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.AreEqual("Index", result.ViewName); }
public void MaintTaskControllerEnsureIndexPageExists() { // Arrange MaintTaskController controller = new MaintTaskController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert Assert.IsNotNull(result); }
public void MaintTaskControllerEnsureItHasThings() { // Arrange MaintTaskController controller = new MaintTaskController(); // Act ViewResult result = controller.Index() as ViewResult; // Assert string expected_message = "My Maint Task Reminders"; Assert.AreEqual(expected_message, result.ViewBag.Message); }
public void MaintTaskControllerEnsureListOfUserMaintTasks() { // Arrange List<MaintTask> data_store_m_tasks = new List<MaintTask> { new MaintTask {Title = "My Maint Task", MaintTaskId = 1, Owner = owner }, new MaintTask {Title = "My Maint Task 2", MaintTaskId = 2, Owner = owner } }; MaintTaskController controller = new MaintTaskController(mock_repository.Object); mock_repository.Setup(r => r.GetAllMaintTasks()).Returns(data_store_m_tasks); // Act ViewResult result = controller.Index() as ViewResult; // Assert CollectionAssert.AreEqual(data_store_m_tasks, result.ViewBag.MaintTasks); }