public void TestDepartmentIndex() { WebSite.Controllers.AreasController controler = new AreasController(); var actResult = controler.Index() as ViewResult; Assert.That(actResult.ViewName, Is.EqualTo("Index")); }
public void Areas_get_List() { var areaReportMock = new Mock<IAreasRepositorio>(); areaReportMock.Setup(a => a.ListarAreasT()).Returns(new List<AREAS>() { new AREAS{ID_AREA=1,NOMBRE="Sistemas"}, new AREAS{ID_AREA=2,NOMBRE="Produccion"}, new AREAS{ID_AREA=3,NOMBRE="Finanzas"} }); var controlador = new AreasController(areaReportMock.Object); var result = controlador.listarAreasTest() as ViewResult; Assert.IsNotNull(result); List<AREAS> list = result.Model as List<AREAS>; Assert.IsNotNull(list); Assert.IsTrue(igualValores(1, "Sistemas", list[0])); Assert.IsTrue(igualValores(2, "Produccion", list[1])); Assert.IsTrue(igualValores(3, "Finanzas", list[2])); }
public void TestMethod1() { var areControl = new AreasController(); //ViewResult resultado = WebSite.Controllers.AreasController as ViewResult; }
public void Pruebaresul() { AreasController controlador = new AreasController(); ViewResult result = controlador.Prueba() as ViewResult; Assert.IsNotNull(result); }
public void TestMethod1() { AreasController controller = new AreasController(); ViewResult result = controller.Index() as ViewResult; Assert.IsNotNull(result); }