public void GetChecksByManager() { ManagerTaskController mtc = new ManagerTaskController(mockManagerTaskDataAccess.Object); ViewResult result = mtc.GetChecksByManager() as ViewResult; mtc.Should().NotBeNull(); result.Should().NotBeNull(); }
public void GetDriver() { ManagerTaskController mtc = new ManagerTaskController(mockManagerTaskDataAccess.Object); string driverName = "Test Manager"; ViewResult result = mtc.GetDriver(driverName) as ViewResult; var driver = result.Model as Driver; mtc.Should().NotBeNull(); result.Should().NotBeNull(); Assert.AreEqual(driver.Name, driverName); }
public void AddDriver() { ManagerTaskController mtc = new ManagerTaskController(mockManagerTaskDataAccess.Object); ViewResult result = mtc.AddDriver() as ViewResult; mtc.Should().NotBeNull(); result.Should().NotBeNull(); string driver = "Test Driver"; result = mtc.AddDriver(driver, null) as ViewResult; result.Should().NotBeNull(); }
public void AddCheck() { ManagerTaskController mtc = new ManagerTaskController(mockManagerTaskDataAccess.Object); ViewResult result = mtc.AddCheck() as ViewResult; mtc.Should().NotBeNull(); result.Should().NotBeNull(); string driver = "Test Driver"; CheckType checkType = CheckType.License; bool success = true; DateTime date = DateTime.Now; var redirectResult = mtc.AddCheck(driver, checkType, success, date) as RedirectToRouteResult; redirectResult.Should().NotBeNull(); Assert.AreNotEqual(redirectResult.RouteName, "GetChecksByDriver"); }