public async Task TransferPet() { var pets = await _petProvider.GetAll(); var petOwners = await _petPolicyProvider.GetAll(); var pet = pets.FirstOrDefault(); var petOwner = petOwners.FirstOrDefault(); if (pet != null && petOwner != null) { var petsWithNewOwner = await _petProvider.TransferPet(pet.PetOwnerId, petOwner.Id); foreach (var p in petsWithNewOwner) { p.PetOwnerId.Should().Be(petOwner.Id); } } }
public async Task <IHttpActionResult> TransferPet(int from, int to) { var result = await _petProvider.TransferPet(from, to); return(Ok(result)); }