public void Index_Return_IActionResult() { //Arrange (Preparar) var priorityController = new PriorityController(parameterService.Object); //Act (Actuar) var actionResult = priorityController.Index(); //Assert (Verificar) Assert.IsType <ViewResult>(actionResult.Result); }
public void Index_Return_Priority_List() { //Arrange (Preparar) var priorityController = new PriorityController(parameterService.Object); parameterService.Setup(x => x.GetPriorityList()).Returns(GetPriorities()); //Act (Actuar) var result = priorityController.Index(); //Assert (Verificar) var viewResult = Assert.IsType <ViewResult>(result.Result); var viewModel = Assert.IsType <List <Priority> >(viewResult.Model); Assert.Equal(4, viewModel.Count); }