From 396f9d065b0622d45dbffb6473584c3451e19af0 Mon Sep 17 00:00:00 2001 From: tj_devel709 Date: Fri, 13 Oct 2023 16:47:11 -0500 Subject: [PATCH] change test --- src/passkit.cs | 1 + .../PassKit/PKPayLaterViewTest.cs | 27 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/passkit.cs b/src/passkit.cs index 07a94e08c5c7..7cb7cbb11420 100644 --- a/src/passkit.cs +++ b/src/passkit.cs @@ -2759,6 +2759,7 @@ interface PKDeferredPaymentRequest { [BaseType (typeof (UIView))] [DisableDefaultCtor] interface PKPayLaterView { + // [DesignatedInitializer] [Export ("initWithAmount:currencyCode:")] NativeHandle Constructor (NSDecimalNumber amount, string currencyCode); diff --git a/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs b/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs index 607b35b153f2..ca9fb436bccb 100644 --- a/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs +++ b/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs @@ -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); + }); + } } } }