public deleteEmployee ( ) : System.Web.Mvc.ActionResult | ||
리턴 | System.Web.Mvc.ActionResult |
public void deleteEmployeeTestPostSuperAdmin() { //Arrange var context = new Mock<ControllerContext>(); var session = new Mock<HttpSessionStateBase>(); context.Setup(m => m.HttpContext.Session).Returns(session.Object); var controller = new AdminEmployeeController(new EmployeeBLL(new EmployeeDALStub()), new UserBLL(new UserDALStub()), new LoggingBLL(new LoggingDALStub())); controller.ControllerContext = context.Object; var employeeModel = new EmployeeModel(); employeeModel.employeeID = 2; employeeModel.firstName = "Ola"; employeeModel.lastName = "Nordmann"; employeeModel.phone = "12345678"; employeeModel.customerAdmin = true; employeeModel.databaseAdmin = true; employeeModel.employeeAdmin = true; employeeModel.password = "******"; employeeModel.productAdmin = true; employeeModel.orderAdmin = true; employeeModel.username = ""; //Act var result = (ViewResult)controller.deleteEmployee(employeeModel); var resultModel = (EmployeeModel)result.Model; //Assert Assert.AreEqual(result.ViewName, ""); }
public void deleteEmployeeTest() { //Arrange var controller = new AdminEmployeeController(new EmployeeBLL(new EmployeeDALStub()), new UserBLL(new UserDALStub()), new LoggingBLL(new LoggingDALStub())); //Act var result = (ViewResult)controller.deleteEmployee(); //Assert Assert.AreEqual(result.ViewName, ""); }