public void ApproveExpenses_ViewData_IsApproveExpensesViewModel() { SupervisorController controller = new SupervisorController(mockEmployeeService, mockReportService, mockEmployee, mockBudgetService); MockHttpContext.SetFakeHttpContext(controller); var result = controller.ApproveExpenses() as ViewResult; Assert.IsInstanceOfType(result.ViewData.Model, typeof(ApproveExpensesViewModel)); }
public void ApproveExpenses_Returns_ActionResult() { SupervisorController controller = new SupervisorController(mockEmployeeService, mockReportService, mockEmployee, mockBudgetService); MockHttpContext.SetFakeHttpContext(controller); var result = controller.ApproveExpenses(); Assert.IsInstanceOfType(result, typeof(ActionResult), "Result is not of ActionResult type"); }
public void ApproveExpenses_Returns_View_ApproveExpenses() { const string expectedViewName ="ApproveExpenses"; SupervisorController controller = new SupervisorController(mockEmployeeService, mockReportService, mockEmployee, mockBudgetService); MockHttpContext.SetFakeHttpContext(controller); var result = controller.ApproveExpenses() as ViewResult; Assert.AreEqual(expectedViewName, result.ViewName, "View names do not match, expected view name is{0}", expectedViewName); }