public async void DeleteLostDogCommentSuccessfulForExistingDogAndComment() { var saveDog = GetValidDog(); var result = await lostDogRepository.AddLostDog(saveDog); Assert.True(result.Successful); var comment = GetValidComment(); comment.DogId = result.Data.Id; var commentResult = await lostDogRepository.AddLostDogComment(comment); Assert.True(commentResult.Successful); var removeResult = await lostDogRepository.DeleteLostDogComment(commentResult.Data.DogId, commentResult.Data.Id); Assert.True(removeResult.Successful); }
public async Task <ServiceResponse> DeleteLostDogComment(int dogId, int commentId) { var repoResponse = await lostDogDataRepository.DeleteLostDogComment(dogId, commentId); var serviceResponse = mapper.Map <ServiceResponse>(repoResponse); if (!serviceResponse.Successful) { serviceResponse.StatusCode = StatusCodes.Status400BadRequest; } return(serviceResponse); }