Esempio n. 1
0
        public async Task RemoveFromPolicyTests_Pet()
        {
            Pet deletedPet;
            var pets = await _petProvider.GetAll();

            var firstPet = pets.FirstOrDefault();

            if (firstPet != null)
            {
                deletedPet = await _petProvider.Delete(firstPet.Id);
            }
            else
            {
                var pet = await _petProvider.Create(
                    new Pet
                {
                    Name       = "ForDeleteFromProvider",
                    BreedName  = "German Shepherd",
                    PetOwnerId = 1
                });

                pet.Archived.Should().Be(false);

                deletedPet = await _petProvider.Delete(pet.Id);
            }
            deletedPet.Archived.Should().Be(true);
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> RemovePetFromPolicy(int id)
        {
            await _petProvider.Delete(id);

            return(Ok());
        }