-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add an async extension to IMASecureSignalsAdapter to make tests easier to follow - Add a test for no identity
- Loading branch information
Showing
4 changed files
with
65 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
Tests/UID2IMAPluginTests/TestExtensions/IMASecureSignalsAdapter+TestExtensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// IMASecureSignalsAdapter+TestExtensions.swift | ||
// | ||
|
||
import GoogleInteractiveMediaAds | ||
|
||
/// Adds an async wrapper interface to simplify testing | ||
extension IMASecureSignalsAdapter { | ||
func collectSignals() async throws -> String? { | ||
try await withCheckedThrowingContinuation { continuation in | ||
collectSignals(completion: { signal, error in | ||
guard error == nil else { | ||
continuation.resume(throwing: error!) | ||
return | ||
} | ||
continuation.resume(returning: signal) | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters