Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
federicocappelli committed Dec 2, 2024
1 parent 38dd352 commit f2b8ca9
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ import Subscription
import Networking

public final class SubscriptionEndpointServiceMock: SubscriptionEndpointService {

public var onSignOut: (() -> Void)?
public var signOutCalled: Bool = false

public init() { }

public var updateCacheWithSubscriptionCalled: Bool = false
public var onUpdateCache: ((PrivacyProSubscription) -> Void)?
public func updateCache(with subscription: Subscription.PrivacyProSubscription) {
onUpdateCache?(subscription)
updateCacheWithSubscriptionCalled = true
}

public func clearSubscription() {}

public var getProductsResult: Result<[GetProductsItem], APIRequestV2.Error>?
public func getProducts() async throws -> [Subscription.GetProductsItem] {
switch getProductsResult! {
case .success(let result): return result
case .failure(let error): throw error
}
}

public var getSubscriptionCalled: Bool = false
public var onGetSubscription: ((String, SubscriptionCachePolicy) -> Void)?
public var getSubscriptionResult: Result<PrivacyProSubscription, SubscriptionEndpointServiceError>?
Expand All @@ -55,23 +55,23 @@ public final class SubscriptionEndpointServiceMock: SubscriptionEndpointService
case .failure(let error): throw error
}
}

public var getCustomerPortalURLResult: Result<GetCustomerPortalURLResponse, APIRequestV2.Error>?
public func getCustomerPortalURL(accessToken: String, externalID: String) async throws -> Subscription.GetCustomerPortalURLResponse {
switch getCustomerPortalURLResult! {
case .success(let result): return result
case .failure(let error): throw error
}
}

public var confirmPurchaseResult: Result<ConfirmPurchaseResponse, APIRequestV2.Error>?
public func confirmPurchase(accessToken: String, signature: String) async throws -> Subscription.ConfirmPurchaseResponse {
switch confirmPurchaseResult! {
case .success(let result): return result
case .failure(let error): throw error
}
}

public var getSubscriptionFeaturesResult: Result<Subscription.GetSubscriptionFeaturesResponse, Error>?
public func getSubscriptionFeatures(for subscriptionID: String) async throws -> Subscription.GetSubscriptionFeaturesResponse {
switch getSubscriptionFeaturesResult! {
Expand Down

0 comments on commit f2b8ca9

Please sign in to comment.