예제 #1
0
        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));
        }
예제 #2
0
        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[]>));
        }
예제 #3
0
        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));
        }