Beispiel #1
0
        public async Task GruposBusiness_ListarEventos_ShouldSearch()
        {
            GruposBusiness gruposBusiness = new GruposBusiness();

            BuscadorDTO buscadorDTO = new BuscadorDTO
            {
                CategoriasParaBuscar = new List <int>
                {
                    3
                },
                EstaturaInicial         = 0,
                EstaturaFinal           = 0,
                PesoInicial             = 0,
                PesoFinal               = 0,
                SkipIndexBase           = 0,
                TakeIndexBase           = 5,
                IdiomaBase              = Idioma.Español,
                IdentificadorParaBuscar = string.Empty
                                          //FechaInicio = new DateTime,
                                          //FechaFinal = FechaFinal
            };

            List <GruposEventosDTO> grupoEventoBuscado = await gruposBusiness.ListarEventos(buscadorDTO);

            Assert.IsNotNull(grupoEventoBuscado);
        }
Beispiel #2
0
        public async Task <IHttpActionResult> ListarEventos(BuscadorDTO buscador)
        {
            if (buscador == null || buscador.SkipIndexBase < 0 || buscador.TakeIndexBase <= 0 || buscador.IdiomaBase == Idioma.SinIdioma)
            {
                return(BadRequest("buscador vacio y/o invalido!."));
            }

            try
            {
                List <GruposEventosDTO> listaEventos = await _grupoBusiness.ListarEventos(buscador);

                return(Ok(listaEventos));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }