Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
tj_devel709 committed Oct 13, 2023
1 parent eaf992b commit 396f9d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/passkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2759,6 +2759,7 @@ interface PKDeferredPaymentRequest {
[BaseType (typeof (UIView))]
[DisableDefaultCtor]
interface PKPayLaterView {
// [DesignatedInitializer]
[Export ("initWithAmount:currencyCode:")]
NativeHandle Constructor (NSDecimalNumber amount, string currencyCode);

Expand Down
27 changes: 11 additions & 16 deletions tests/monotouch-test/PassKit/PKPayLaterViewTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@ public void ValidateAmountTest ()
{
TestRuntime.AssertXcodeVersion (15, 0);

var payLaterView = new PKPayLaterView (new NSDecimalNumber (50), "USD");
payLaterView.ValidateAmount (new NSDecimalNumber (50), "USD", (eligible) => {
Assert.True (eligible);
});

payLaterView.ValidateAmount (new NSDecimalNumber (1), "USD", (eligible) => {
Assert.False (eligible);
});

payLaterView.ValidateAmount (new NSDecimalNumber (1000000), "USD", (eligible) => {
Assert.False (eligible);
});

payLaterView.ValidateAmount (new NSDecimalNumber (50), "USD", (eligible) => {
Assert.True (eligible);
});
var payLaterView = new PKPayLaterView (new NSDecimalNumber (100), "USD");

// From testing with Xcode 15.0.0, all values give the value of false to the completion handler.
// Perhaps this will change in the future.
// Also appears to be a static method in Xcode 15.0.0 but not in the headers or docs.
// Apple feedback was submitted here: https://feedbackassistant.apple.com/feedback/13268898
for (int i = 0; i < 1000; i++){
payLaterView.ValidateAmount (new NSDecimalNumber (i), "USD", (eligible) => {
Assert.False (eligible);
});
}
}
}
}
Expand Down

0 comments on commit 396f9d0

Please sign in to comment.