[passkit] API audit: remove default .ctor on PKLabeledValue, add tests for PKLabeledValue and add xtro comments (#979)

This commit is contained in:
Sebastien Pouliot 2016-10-12 05:30:11 -04:00 коммит произвёл Vincent Dondain
Родитель ae54390ccf
Коммит 24b7b5be2e
6 изменённых файлов: 71 добавлений и 0 удалений

Просмотреть файл

@ -800,6 +800,7 @@ namespace XamCore.PassKit {
[iOS (10,1)]
[NoWatch] // Radar: https://trello.com/c/MvaHEZlc
[BaseType (typeof(NSObject))]
[DisableDefaultCtor] // there's a designated initializer and it does not accept null
interface PKLabeledValue
{
[Export ("initWithLabel:value:")]

Просмотреть файл

@ -102,6 +102,18 @@ partial class TestRuntime
return CheckMacSystemVersion (10, 12, 0);
#else
throw new NotImplementedException ();
#endif
case 1:
#if __WATCHOS__
return CheckWatchOSSystemVersion (3, 1);
#elif __TVOS__
return ChecktvOSSystemVersion (10, 0);
#elif __IOS__
return CheckiOSSystemVersion (10, 1);
#elif MONOMAC
return CheckMacSystemVersion (10, 12, 1);
#else
throw new NotImplementedException ();
#endif
default:
throw new NotImplementedException ();

Просмотреть файл

@ -0,0 +1,40 @@
#if __IOS__
using System;
#if XAMCORE_2_0
using Foundation;
using PassKit;
#else
using MonoTouch.Foundation;
using MonoTouch.PassKit;
#endif
using NUnit.Framework;
namespace MonoTouchFixtures.PassKit {
[TestFixture]
[Preserve (AllMembers = true)]
public class PKLabeledValueTest {
[SetUp]
public void SetUp ()
{
TestRuntime.AssertXcodeVersion (8, 1);
}
[Test]
public void Constructor ()
{
using (var lv = new PKLabeledValue ("", "")) {
Assert.That (lv.Label, Is.Empty, "Label1");
Assert.That (lv.Value, Is.Empty, "Value1");
}
using (var lv = new PKLabeledValue ("Label", "Value")) {
Assert.That (lv.Label, Is.EqualTo ("Label"), "Label2");
Assert.That (lv.Value, Is.EqualTo ("Value"), "Value2");
}
}
}
}
#endif

Просмотреть файл

@ -574,6 +574,7 @@
<Compile Include="CoreMidi\MidiEndpointTest.cs" />
<Compile Include="HealthKit\CdaDocumentSampleTest.cs" />
<Compile Include="Metal\HeapDescriptorTest.cs" />
<Compile Include="PassKit\LabeledValueTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<ItemGroup>

Просмотреть файл

@ -109,6 +109,13 @@
!missing-selector! GKVoiceChatService::stopVoiceChatWithParticipantID: not bound
#PassKit
## enums added in Xcode 8.1 but the only API using them are not available on watchOS
!missing-enum! PKPaymentButtonStyle not bound
!missing-enum! PKPaymentButtonType not bound
# UIKit
## Implemented in managed code

Просмотреть файл

@ -91,6 +91,16 @@
!missing-selector! HMCameraStream::setAudioStreamSetting: not bound
#PassKit
## No availability macro is provided for PKLabeledValue on watchOS / radar: https://trello.com/c/MvaHEZlc
## on iOS it's only used in PKAddPaymentPassRequestConfiguration which is not part of watchOS
!missing-selector! PKLabeledValue::initWithLabel:value: not bound
!missing-selector! PKLabeledValue::label not bound
!missing-selector! PKLabeledValue::value not bound
!missing-type! PKLabeledValue not bound
# SceneKit
## CoreAnimation (CAAAnimation) is not in available watchOS 3