[tests][link all] Workaround issue with UIPasteboard.General.Images

ref: https://github.com/xamarin/xamarin-macios/issues/6254
This commit is contained in:
Sebastien Pouliot 2019-06-12 13:57:51 -04:00
Родитель 31014b0367
Коммит 71f9341c59
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -310,6 +310,13 @@ namespace LinkAll {
using (var cgimg = CGImage.FromPNG (dp, null, false, CGColorRenderingIntent.Default)) { using (var cgimg = CGImage.FromPNG (dp, null, false, CGColorRenderingIntent.Default)) {
using (var img = new UIImage (cgimg)) { using (var img = new UIImage (cgimg)) {
UIPasteboard.General.Images = new UIImage[] { img }; UIPasteboard.General.Images = new UIImage[] { img };
if (TestRuntime.CheckXcodeVersion (8,0))
Assert.True (UIPasteboard.General.HasImages, "HasImages");
// https://github.com/xamarin/xamarin-macios/issues/6254
if (TestRuntime.CheckXcodeVersion (11, 0))
return;
Assert.AreEqual (1, UIPasteboard.General.Images.Length, "a - length"); Assert.AreEqual (1, UIPasteboard.General.Images.Length, "a - length");
UIPasteboard.General.Images = new UIImage[] { img, img }; UIPasteboard.General.Images = new UIImage[] { img, img };