public async void GetDogsForValidShelterSuccessful()
        {
            var dog = await shelterDogRepository.AddShelterDog(GetValidShelterDog());

            Assert.True(dog.Successful);

            var result = await shelterDogRepository.GetShelterDogs(dog.Data.ShelterId, 0, 50);

            Assert.True(result.Successful && result.Data.Count > 0);
        }
Exemple #2
0
        public async Task <ServiceResponse <List <GetShelterDogDto>, int> > GetShelterDogs(int shelterId, int page, int size)
        {
            var repoResponse = await shelterDogRepository.GetShelterDogs(shelterId, page, size);

            var serviceResponse = mapper.Map <ServiceResponse <List <GetShelterDogDto>, int> >(repoResponse);

            if (!serviceResponse.Successful)
            {
                serviceResponse.StatusCode = StatusCodes.Status400BadRequest;
            }
            return(serviceResponse);
        }