コード例 #1
0
 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));
 }
コード例 #2
0
        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");
        }
コード例 #3
0
        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);
        }