Skip to content

Commit

Permalink
Simplified call
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Sep 20, 2023
1 parent 9d92e7d commit b4da438
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RevenueCatUI/Purchasing/PurchaseHandler+TestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import RevenueCat
@available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
extension PurchaseHandler {

static func mock(customerInfo: CustomerInfo = TestData.customerInfo) -> Self {
static func mock(_ customerInfo: CustomerInfo = TestData.customerInfo) -> Self {
return self.init(
purchases: MockPurchases { _ in
return (
Expand Down
4 changes: 2 additions & 2 deletions Tests/RevenueCatUITests/Purchasing/PurchaseHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ class PurchaseHandlerTests: TestCase {
}

func testRestorePurchasesWithActiveSubscriptions() async throws {
let handler: PurchaseHandler = .mock(customerInfo: Self.customerInfoWithSubscriptions)
let handler: PurchaseHandler = .mock(Self.customerInfoWithSubscriptions)

let result = try await handler.restorePurchases()
expect(result.info) === Self.customerInfoWithSubscriptions
expect(result.success) == true
}

func testRestorePurchasesWithNonSubscriptions() async throws {
let handler: PurchaseHandler = .mock(customerInfo: Self.customerInfoWithNonSubscriptions)
let handler: PurchaseHandler = .mock(Self.customerInfoWithNonSubscriptions)

let result = try await handler.restorePurchases()
expect(result.info) === Self.customerInfoWithNonSubscriptions
Expand Down

0 comments on commit b4da438

Please sign in to comment.