Example #1
0
        public void ProbarCrear()
        {
            var controller = new PreguntasController();
            var result     = controller.Create() as ViewResult;

            Assert.AreEqual("Create", result.ViewName);
        }
Example #2
0
        public void PreguntasGeneralNoNulo()
        {
            PreguntasController preguntas = new PreguntasController();

            ViewResult result = preguntas.Create() as ViewResult;

            Assert.IsNotNull(result);
        }
Example #3
0
        public void CreatePostNoNula()
        {
            PreguntasController preguntas = new PreguntasController();

            ViewResult result = preguntas.Create() as ViewResult;

            Assert.IsNotNull(result);
        }
Example #4
0
        public void ProbarViewbagGeneral()
        {
            // Arrange
            var controller = new PreguntasController();
            // Act
            ViewResult result = controller.Create() as ViewResult;

            // Assert
            Assert.AreEqual("Crear pregunta", result.ViewBag.Message);
        }
Example #5
0
        public void ProbarPostNoNulaConPregunta()
        {
            PreguntasController preguntas = new PreguntasController();

            preguntas.ModelState.Clear();

            Pregunta pregunta = new Pregunta
            {
                Codigo    = "",
                Enunciado = ""
            };

            ViewResult result = preguntas.Create() as ViewResult;

            Assert.AreEqual("Create", result.ViewName);
        }
Example #6
0
        public void EstudianteCreaPregunta()
        {
            PreguntasController preguntas = new PreguntasController();

            preguntas.ModelState.Clear();
            CurrentUser.clearSession();
            CurrentUser.setCurrentUser("*****@*****.**", "Estudiante", "0000000001", "0000000001");


            Pregunta pregunta = new Pregunta
            {
                Codigo    = "",
                Enunciado = ""
            };

            ViewResult result = preguntas.Create() as ViewResult;

            Assert.IsNull(result);
        }