Improvements on the AmiiboService service type initialization #12

Merged
javier merged 6 commits from improvement/api-client into main 2025-09-12 00:13:59 +00:00
2 changed files with 5 additions and 8 deletions
Showing only changes of commit e5a541206a - Show all commits
@@ -18,17 +18,14 @@ public struct AmiiboService {
// MARK: Properties
/// A client to interact with the endpoints.
private let client: any APIClient
private let client: any AmiiboClient
// MARK: Initializers
/// Initializes this service with a specific client type.
/// - Parameter client: A representation of a client to use to interact with the endpoints.
public init(_ client: AmiiboClient) {
self.client = switch client {
case let .mock(mockClient): mockClient
case let .live(liveClient): liveClient
}
/// - Parameter client: A client to use to interact with the endpoints.
public init(client: some AmiiboClient = AmiiboLiveClient()) {
self.client = client
}
// MARK: Functions
@@ -24,7 +24,7 @@ struct AmiiboServiceLiveTests {
// MARK: Initializers
init() {
self.service = .init(.live())
self.service = .init()
}
// MARK: Functions tests