-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uikit] Add UIPasteConfigurationSupporting and UITextPasteConfigurati…
…onSupporting - Fixes bug #59363: Missing UIPasteConfigurationSupporting, UITextPasteConfigurationSupporting, UITextDraggable and UITextDroppable on a couple of types (https://bugzilla.xamarin.com/show_bug.cgi?id=59363)
- Loading branch information
1 parent
343c0b3
commit 8d0d884
Showing
5 changed files
with
242 additions
and
5 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
90 changes: 90 additions & 0 deletions
90
tests/monotouch-test/UIKit/UIPasteConfigurationSupportingTest.cs
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,90 @@ | ||
// | ||
// Unit tests for UIPasteConfigurationSupportingTest | ||
// | ||
// Authors: | ||
// Vincent Dondain <[email protected]> | ||
// | ||
// | ||
// Copyright 2017 Microsoft. | ||
// | ||
|
||
#if !__TVOS__ && !__WATCHOS__ | ||
|
||
using System; | ||
#if XAMCORE_2_0 | ||
using CoreGraphics; | ||
using Foundation; | ||
using SpriteKit; | ||
using ObjCRuntime; | ||
using UIKit; | ||
#else | ||
using MonoTouch.CoreGraphics; | ||
using MonoTouch.Foundation; | ||
using MonoTouch.SpriteKit; | ||
using MonoTouch.ObjCRuntime; | ||
using MonoTouch.UIKit; | ||
#endif | ||
using NUnit.Framework; | ||
|
||
namespace MonoTouchFixtures.UIKit { | ||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class UIPasteConfigurationSupportingTest { | ||
|
||
[SetUp] | ||
public void Setup () | ||
{ | ||
TestRuntime.AssertXcodeVersion (9, 0); | ||
} | ||
|
||
[Test] | ||
public void UIViewControllerPasteTest () | ||
{ | ||
var viewController = new ViewControllerPoker (); | ||
viewController.PasteConfiguration = new UIPasteConfiguration (typeof (UIImage)); | ||
viewController.Paste (new NSItemProvider [] { new NSItemProvider (new UIImage ()) }); | ||
} | ||
|
||
[Test] | ||
public void UIViewPasteTest () | ||
{ | ||
var view = new ViewPoker (); | ||
view.PasteConfiguration = new UIPasteConfiguration (typeof (UIImage)); | ||
view.Paste (new NSItemProvider [] { new NSItemProvider (new UIImage ()) }); | ||
} | ||
|
||
[Test] | ||
public void SKNodeTest () | ||
{ | ||
var node = new NodePoker (); | ||
node.PasteConfiguration = new UIPasteConfiguration (typeof (UIImage)); | ||
node.Paste (new NSItemProvider [] { new NSItemProvider (new UIImage ()) }); | ||
} | ||
|
||
class ViewControllerPoker : UIViewController { | ||
|
||
public override void Paste (NSItemProvider [] itemProviders) | ||
{ | ||
Assert.IsTrue (itemProviders [0].CanLoadObject (typeof (UIImage))); | ||
} | ||
} | ||
|
||
class ViewPoker : UIView { | ||
|
||
public override void Paste (NSItemProvider [] itemProviders) | ||
{ | ||
Assert.IsTrue (itemProviders [0].CanLoadObject (typeof (UIImage))); | ||
} | ||
} | ||
|
||
class NodePoker : SKNode { | ||
|
||
public override void Paste (NSItemProvider [] itemProviders) | ||
{ | ||
Assert.IsTrue (itemProviders [0].CanLoadObject (typeof (UIImage))); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#endif // !__TVOS__ && !__WATCHOS__ |
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