public void Dispose() { // remove the pet after testing try { _petApi.DeletePet(PetId); } catch (ApiException ex) when(ex.ErrorCode == 404) { } _petApi.Dispose(); _httpClient.Dispose(); }