-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OfflineEntitlementsManager
: disable offline CustomerInfo
in obser…
…ver mode (#2520)
- Loading branch information
Showing
9 changed files
with
125 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
51 changes: 51 additions & 0 deletions
51
Tests/UnitTests/OfflineEntitlements/OfflineCustomerInfoCreatorTests.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,51 @@ | ||
// | ||
// Copyright RevenueCat Inc. All Rights Reserved. | ||
// | ||
// Licensed under the MIT License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://opensource.org/licenses/MIT | ||
// | ||
// OfflineCustomerInfoCreatorTests.swift | ||
// | ||
// Created by Nacho Soto on 5/23/23. | ||
|
||
import Nimble | ||
@testable import RevenueCat | ||
import StoreKit | ||
import XCTest | ||
|
||
class OfflineCustomerInfoCreatorTests: TestCase { | ||
|
||
func testCreateIfAvailableWithNoFetcherReturnsNil() { | ||
expect( | ||
OfflineCustomerInfoCreator.createIfAvailable( | ||
with: nil, | ||
productEntitlementMappingFetcher: MockProductEntitlementMappingFetcher(), | ||
observerMode: false | ||
) | ||
).to(beNil()) | ||
} | ||
|
||
func testCreateIfAvailableInObserverMode() { | ||
expect( | ||
OfflineCustomerInfoCreator.createIfAvailable( | ||
with: MockPurchasedProductsFetcher(), | ||
productEntitlementMappingFetcher: MockProductEntitlementMappingFetcher(), | ||
observerMode: true | ||
) | ||
).to(beNil()) | ||
} | ||
|
||
func testCreateIfAvailable() { | ||
expect( | ||
OfflineCustomerInfoCreator.createIfAvailable( | ||
with: MockPurchasedProductsFetcher(), | ||
productEntitlementMappingFetcher: MockProductEntitlementMappingFetcher(), | ||
observerMode: false | ||
) | ||
).toNot(beNil()) | ||
} | ||
|
||
} |
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