Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pr comments
  • Loading branch information
LouiseHsu committed Feb 21, 2024
commit b0aa7cc2df16e94df220cf36d6162844787cfb67
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ - (void)presentCodeRedemptionSheetWithError:
#endif
}

- (NSString *_Nullable)retrieveReceiptDataWithError:
- (nullable NSString *)retrieveReceiptDataWithError:
(FlutterError *_Nullable __autoreleasing *_Nonnull)error {
FlutterError *flutterError;
NSString *receiptData = [self.receiptManager retrieveReceiptWithError:&flutterError];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ - (void)testRestoreTransactions {

- (void)testRetrieveReceiptDataSuccess {
FlutterError *error;
id result = [self.plugin retrieveReceiptDataWithError:&error];
NSString *result = [self.plugin retrieveReceiptDataWithError:&error];
XCTAssertNotNil(result);
XCTAssert([result isKindOfClass:[NSString class]]);
}
Expand All @@ -295,15 +295,15 @@ - (void)testRetrieveReceiptDataNil {
NSBundle *mockBundle = OCMPartialMock([NSBundle mainBundle]);
OCMStub(mockBundle.appStoreReceiptURL).andReturn(nil);
FlutterError *error;
id result = [self.plugin retrieveReceiptDataWithError:&error];
NSString *result = [self.plugin retrieveReceiptDataWithError:&error];
XCTAssertNil(result);
}

- (void)testRetrieveReceiptDataError {
self.receiptManagerStub.returnError = YES;

FlutterError *error;
id result = [self.plugin retrieveReceiptDataWithError:&error];
NSString *result = [self.plugin retrieveReceiptDataWithError:&error];

XCTAssertNil(result);
XCTAssertNotNil(error);
Expand All @@ -324,6 +324,7 @@ - (void)testRefreshReceiptRequest {
}

#if TARGET_OS_IOS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this only for iOS? Add a quick comment in the code if you intended this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

/// presentCodeRedemptionSheetWithError:error is only available on iOS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put this before the #if please?

- (void)testPresentCodeRedemptionSheet {
FIAPaymentQueueHandler *mockHandler = OCMClassMock([FIAPaymentQueueHandler class]);
self.plugin.paymentQueueHandler = mockHandler;
Expand Down