mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Generating SDK Mocks through the usage of swift run tools generate-sdk-mocks (#982)
* basic implementation, that works for now only with the local SDK * replaced a handmade mock with a generated mock
This commit is contained in:
@@ -1094,10 +1094,10 @@ class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol {
|
||||
}
|
||||
var searchProfilesWithReceivedSearchQuery: String?
|
||||
var searchProfilesWithReceivedInvocations: [String] = []
|
||||
var searchProfilesWithReturnValue: Result<[UserProfile], UserDiscoveryErrorType>!
|
||||
var searchProfilesWithClosure: ((String) async -> Result<[UserProfile], UserDiscoveryErrorType>)?
|
||||
var searchProfilesWithReturnValue: Result<[UserProfileProxy], UserDiscoveryErrorType>!
|
||||
var searchProfilesWithClosure: ((String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType>)?
|
||||
|
||||
func searchProfiles(with searchQuery: String) async -> Result<[UserProfile], UserDiscoveryErrorType> {
|
||||
func searchProfiles(with searchQuery: String) async -> Result<[UserProfileProxy], UserDiscoveryErrorType> {
|
||||
searchProfilesWithCallsCount += 1
|
||||
searchProfilesWithReceivedSearchQuery = searchQuery
|
||||
searchProfilesWithReceivedInvocations.append(searchQuery)
|
||||
@@ -1113,10 +1113,10 @@ class UserDiscoveryServiceMock: UserDiscoveryServiceProtocol {
|
||||
var fetchSuggestionsCalled: Bool {
|
||||
return fetchSuggestionsCallsCount > 0
|
||||
}
|
||||
var fetchSuggestionsReturnValue: Result<[UserProfile], UserDiscoveryErrorType>!
|
||||
var fetchSuggestionsClosure: (() async -> Result<[UserProfile], UserDiscoveryErrorType>)?
|
||||
var fetchSuggestionsReturnValue: Result<[UserProfileProxy], UserDiscoveryErrorType>!
|
||||
var fetchSuggestionsClosure: (() async -> Result<[UserProfileProxy], UserDiscoveryErrorType>)?
|
||||
|
||||
func fetchSuggestions() async -> Result<[UserProfile], UserDiscoveryErrorType> {
|
||||
func fetchSuggestions() async -> Result<[UserProfileProxy], UserDiscoveryErrorType> {
|
||||
fetchSuggestionsCallsCount += 1
|
||||
if let fetchSuggestionsClosure = fetchSuggestionsClosure {
|
||||
return await fetchSuggestionsClosure()
|
||||
|
||||
Reference in New Issue
Block a user