public async Task TestGetAllAnimalOwnership() { var controller = new AnimalOwnershipsController(context); var ownedAnimals = await controller.GetAnimalOwnership(); Assert.Equal(EXPECTED_SIZE_OF_ALL, ownedAnimals.Value.Count()); }
public async Task TestGetAnimalOwnershipInappropriateId() { var controller = new AnimalOwnershipsController(context); var ownedAnimal = await controller.GetAnimalOwnership(INAPPROPRIATE_ID_TO_FIND); // Assert var actionResult = Assert.IsType <ActionResult <AnimalOwnership> >(ownedAnimal); Assert.IsType <NotFoundResult>(actionResult.Result); }
public async Task TestGetAnimalOwnershipAppropriateId() { var controller = new AnimalOwnershipsController(context); var ownedAnimal = await controller.GetAnimalOwnership(ID_TO_FIND); var actionResult = Assert.IsType <ActionResult <AnimalOwnership> >(ownedAnimal); Assert.NotNull(actionResult); Assert.Equal(ID_TO_FIND, actionResult.Value.Id); }