コード例 #1
0
ファイル: Test.cs プロジェクト: jeysson12/SisWebAsistencia
        public void TestDepartmentIndex()
        {
            WebSite.Controllers.AreasController controler = new AreasController();

            var actResult = controler.Index() as ViewResult;

            Assert.That(actResult.ViewName, Is.EqualTo("Index"));
        }
コード例 #2
0
        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]));
        }
コード例 #3
0
 public void TestMethod1()
 {
     var areControl = new AreasController();
     //ViewResult resultado = WebSite.Controllers.AreasController as ViewResult;
 }
コード例 #4
0
 public void Pruebaresul()
 {
     AreasController controlador = new AreasController();
     ViewResult result = controlador.Prueba() as ViewResult;
     Assert.IsNotNull(result);
 }
コード例 #5
0
 public void TestMethod1()
 {
     AreasController controller = new AreasController();
     ViewResult result = controller.Index() as ViewResult;
     Assert.IsNotNull(result);
 }