Beispiel #1
0
        // RIP CF5
        public void TestCreateFilterEnunciadoNotNull()
        {
            SeccionController seccionController = new SeccionController();

            ViewResult result = seccionController.Create(null, "Info", null, null) as ViewResult;

            Assert.IsNotNull(result);
        }
Beispiel #2
0
        // RIP CF5
        public void TestCreateFilterCodigoNotNull()
        {
            SeccionController seccionController = new SeccionController();

            ViewResult result = seccionController.Create("00000001", "", "", "") as ViewResult;

            Assert.IsNotNull(result);
        }
Beispiel #3
0
        public void TestCreateFilterNullNotNull()
        {
            SeccionController seccionController = new SeccionController();

            // Null
            ViewResult result = seccionController.Create(null, null, null, null) as ViewResult;

            Assert.IsNotNull(result);
        }
        public void TestCreateView()
        {
            // Arrange
            SeccionController controller = new SeccionController();

            // Act
            ViewResult result = controller.Create() as ViewResult;

            // Assert
            Assert.AreEqual(result.ViewName, "Create");
        }
Beispiel #5
0
        // Prueba de que la vista no sea nula
        public void TestCreateNotNull()
        {
            // Arrange
            SeccionController seccionController = new SeccionController();

            // Act
            ViewResult result = seccionController.Create() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
Beispiel #6
0
        public void TestCreateFilterTiposNotNull()
        {
            SeccionController seccionController = new SeccionController();

            ViewResult result = seccionController.Create("", "", "U", "") as ViewResult;

            Assert.IsNotNull(result);

            result = seccionController.Create("", "", "M", "") as ViewResult;
            Assert.IsNotNull(result);

            result = seccionController.Create("", "", "L", "") as ViewResult;
            Assert.IsNotNull(result);

            result = seccionController.Create("", "", "S", "") as ViewResult;
            Assert.IsNotNull(result);

            result = seccionController.Create("", "", "E", "") as ViewResult;
            Assert.IsNotNull(result);
        }
Beispiel #7
0
        public void InsertsSeccion()
        {
            SeccionController sController = new SeccionController();
            Seccion           seccion     = new Seccion()
            {
                Nombre = "AAR4"
            };

            sController.Create(seccion);
            ApplicationDbContext db = new ApplicationDbContext();

            seccion = db.Seccion.Where(s => s.Nombre == "AAR4").First();
            Assert.IsTrue(seccion != null);
            db.Seccion.Remove(seccion);
        }
        public void TestCreateDataMock()
        {
            // Arrange
            var     mockDb  = new Mock <Opiniometro_DatosEntities>();
            string  titulo  = "Prueba1";
            Seccion seccion = new Seccion()
            {
                Titulo = "Prueba1", Descripcion = "Programación I"
            };

            mockDb.Setup(m => m.Seccion.Find(titulo)).Returns(seccion);
            SeccionController controller = new SeccionController(mockDb.Object);

            // Act
            controller.Create(seccion);
            ViewResult result = controller.Details(titulo) as ViewResult;

            //Assert.IsNull();
            // Assert
            Assert.AreEqual(result.Model, seccion);
        }