public async Task <WrapperSimpleTypesDTO> EliminarAnuncioContenido(AnunciosContenidosDTO anuncioContenidoParaEliminar) { if (anuncioContenidoParaEliminar == null) { throw new ArgumentNullException("No puedes eliminar un anuncioContenido si anuncioContenidoParaEliminar es nulo!."); } if (anuncioContenidoParaEliminar.Consecutivo <= 0) { throw new ArgumentException("anuncioContenidoParaEliminar vacio y/o invalido!."); } IHttpClient client = ConfigurarHttpClient(); WrapperSimpleTypesDTO wrapperEliminarAnuncioContenido = await client.PostAsync <AnunciosContenidosDTO, WrapperSimpleTypesDTO>("Anunciantes/EliminarAnuncioContenido", anuncioContenidoParaEliminar); return(wrapperEliminarAnuncioContenido); }
public async Task <WrapperSimpleTypesDTO> ModificarAnuncioContenido(AnunciosContenidosDTO anuncioContenidoParaModificar) { if (anuncioContenidoParaModificar == null) { throw new ArgumentNullException("No puedes modificar un anuncioContenido si anuncioContenidoParaModificar es nulo!."); } if (anuncioContenidoParaModificar.Consecutivo <= 0 || string.IsNullOrWhiteSpace(anuncioContenidoParaModificar.Titulo)) { throw new ArgumentException("anuncioContenidoParaModificar vacio y/o invalido!."); } IHttpClient client = ConfigurarHttpClient(); WrapperSimpleTypesDTO wrapperModificarAnuncioContenido = await client.PostAsync <AnunciosContenidosDTO, WrapperSimpleTypesDTO>("Anunciantes/ModificarAnuncioContenido", anuncioContenidoParaModificar); return(wrapperModificarAnuncioContenido); }
public async Task <AnunciosContenidosDTO> BuscarAnuncioContenidoPorConsecutivo(AnunciosContenidosDTO anuncioContenidoParaBuscar) { if (anuncioContenidoParaBuscar == null) { throw new ArgumentNullException("No puedes buscar un anuncioContenido si anuncioContenidoParaBuscar es nulo!."); } if (anuncioContenidoParaBuscar.Consecutivo <= 0) { throw new ArgumentException("anuncioContenidoParaBuscar vacio y/o invalido!."); } IHttpClient client = ConfigurarHttpClient(); AnunciosContenidosDTO anuncioContenidoBuscado = await client.PostAsync("Anunciantes/BuscarAnuncioContenidoPorConsecutivo", anuncioContenidoParaBuscar); return(anuncioContenidoBuscado); }
public async Task AnunciantesServices_ListarAnunciosContenidosDeUnAnuncio_ShouldList() { AnunciantesServices anuncianteServices = new AnunciantesServices(); AnunciosContenidosDTO anuncio = new AnunciosContenidosDTO { CodigoAnuncio = 2 }; List <AnunciosContenidosDTO> lstAnunciosContenidos = await anuncianteServices.ListarAnunciosContenidosDeUnAnuncio(anuncio); Assert.IsNotNull(lstAnunciosContenidos); Assert.IsTrue(lstAnunciosContenidos.Count > 0); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Anuncios == null)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.AnunciosContenidos.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.CategoriasContenidos.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.GruposEventos.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.HabilidadesContenidos.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.Paises.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.Personas.Count == 0)); Assert.IsTrue(lstAnunciosContenidos.TrueForAll(x => x.Idiomas.PlanesContenidos.Count == 0)); }
public async Task <List <AnunciosContenidosDTO> > ListarAnunciosContenidosDeUnAnuncio(AnunciosContenidosDTO anuncioContenidoParaListar) { if (anuncioContenidoParaListar == null) { throw new ArgumentNullException("No puedes listar los anunciosContenidos si anuncioContenidoParaListar es nulo!."); } if (anuncioContenidoParaListar.CodigoAnuncio <= 0) { throw new ArgumentException("anuncioContenidoParaListar vacio y/o invalido!."); } IHttpClient client = ConfigurarHttpClient(); List <AnunciosContenidosDTO> listaContenidoDeUnAnuncio = await client.PostAsync <AnunciosContenidosDTO, List <AnunciosContenidosDTO> >("Anunciantes/ListarAnunciosContenidosDeUnAnuncio", anuncioContenidoParaListar); return(listaContenidoDeUnAnuncio); }