예제 #1
0
        public async Task WhenYoEjecutoElServicioAsync(string nombreServicio)
        {
            Servicios.Inicializa();
            var response = await Servicios.PostAsync(nombreServicio, login);

            if (!string.IsNullOrEmpty(response))
            {
                token = JsonSerializer.Deserialize <TokenDTO>(response);
            }
        }
예제 #2
0
        public async Task AgregaNuevaCategoria_DatosCorrectos_RegresaVerdaderoAsync()
        {
            //Inicialización de datos (Arrange)
            Servicios.Inicializa();
            contexto = Servicios.caducaContext;
            var categoriaDAO = new CategoriaDAO(contexto, locService);
            var categoria    = new Categoria();

            categoria.Clave  = 2;
            categoria.Nombre = "Antibióticos";
            //Método a probar (Act)
            var esCorrecto = await categoriaDAO.AgregarAsync(categoria);

            //Comprobación de resultados (Assert)
            Assert.IsTrue(esCorrecto);
        }