public void MuestraLista() { var service = new Mock <IUsuarioService>(); service.Setup(o => o.GetLoggedUser()).Returns("admin"); var repository = new Mock <ICursoRepository>(); repository.Setup(o => o.ObtenerTodosLosCursos()).Returns(new List <Curso>()); var controller = new CursoController(repository.Object, service.Object); var view = controller.Index() as ViewResult; Assert.AreEqual("Index", view.ViewName); }