예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        public async Task <IHttpActionResult> TransferPet(int from, int to)
        {
            var result = await _petProvider.TransferPet(from, to);

            return(Ok(result));
        }