public async Task <ServiceResponse <List <GetLostDogDto>, int> > GetLostDogs(LostDogFilter filter, string sort, int page, int size)
        {
            var repoResponse = await lostDogDataRepository.GetLostDogs(filter, sort, page, size);

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

            if (!serviceResponse.Successful)
            {
                serviceResponse.StatusCode = StatusCodes.Status400BadRequest;
            }
            return(serviceResponse);
        }
Exemplo n.º 2
0
        public async void GettingLostDogsForUserOneSuccessful(int userId)
        {
            var filter = new LostDogFilter()
            {
                OwnerId = userId
            };
            var result = await lostDogRepository.GetLostDogs(filter, null, 0, 10);

            Assert.True(result.Successful);
        }