-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start implementing AutofillMockResponse for integration tests with Au…
…tofill - Add static MockResponse.apiType and associated type Mock in MockServerIntegrationTestCase so that subclasses can query Mock.apiType when instantiating SearchEngines based on the generic. - Also provides the MockResponse parameter generic type - Add extension on CoreSearchEngine.ApiType to bridge to MapboxSearch.ApiType enum (does not contain Autofill or search-box) - Replace hard-coded apiType: .geocoding parameters with XCTUnwrap(apiType: Mock.coreApiType.toSDKType()) - Add AutofillMockResponse with only endpoints used by the Autofill engine and tests!
- Loading branch information
Showing
9 changed files
with
93 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
Tests/MapboxSearchTests/Common/Extensions/CoreApiType+ToSDKType.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,17 @@ | ||
@testable import MapboxSearch | ||
|
||
extension CoreSearchEngine.ApiType { | ||
func toSDKType() -> ApiType? { | ||
switch self { | ||
case .geocoding: | ||
return .geocoding | ||
case .SBS: | ||
return .SBS | ||
case .autofill, | ||
.searchBox: | ||
return nil | ||
@unknown default: | ||
fatalError() | ||
} | ||
} | ||
} |
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