public void WhenLoginUserIsNullThenBadrequest() { // Disponer //ValuesController controller = new ValuesController(); AccionaITController controller = new AccionaITController(); User user = null; // Actuar IHttpActionResult result = controller.LoguerUsuario(user); // Declarar Assert.IsInstanceOfType(result, typeof(BadRequestErrorMessageResult)); }
public void WhenLoginUserIsvalidThenOk() { // Disponer //ValuesController controller = new ValuesController(); AccionaITController controller = new AccionaITController(); User user = new User { usuario = "admin", password = "******" }; // Actuar IHttpActionResult result = controller.LoguerUsuario(user); // Declarar Assert.IsInstanceOfType(result, typeof(OkNegotiatedContentResult <string[]>)); }
public void WhenLoginUserIsInvalidThenBadRequest() { // Disponer //ValuesController controller = new ValuesController(); AccionaITController controller = new AccionaITController(); User user = new User { usuario = "pepe", password = "******" }; // Actuar IHttpActionResult result = controller.LoguerUsuario(user); // Declarar Assert.IsInstanceOfType(result, typeof(BadRequestErrorMessageResult)); }