public void ProbarCrear() { var controller = new PreguntasController(); var result = controller.Create() as ViewResult; Assert.AreEqual("Create", result.ViewName); }
public void PreguntasGeneralNoNulo() { PreguntasController preguntas = new PreguntasController(); ViewResult result = preguntas.Create() as ViewResult; Assert.IsNotNull(result); }
public void CreatePostNoNula() { PreguntasController preguntas = new PreguntasController(); ViewResult result = preguntas.Create() as ViewResult; Assert.IsNotNull(result); }
public void ProbarViewbagGeneral() { // Arrange var controller = new PreguntasController(); // Act ViewResult result = controller.Create() as ViewResult; // Assert Assert.AreEqual("Crear pregunta", result.ViewBag.Message); }
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); }
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); }