maui-linux/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issu.../Issue2222.cs

51 строка
1.0 KiB
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
2016-03-22 23:02:25 +03:00
#if UITEST
using NUnit.Framework;
using Xamarin.UITest;
#endif
namespace Xamarin.Forms.Controls.Issues
2016-03-22 23:02:25 +03:00
{
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Github, 2222, "NavigationBar.ToolbarItems.Add() crashes / breaks app in iOS7. works fine in iOS8", PlatformAffected.iOS)]
public class Issue2222 : TestNavigationPage
{
protected override void Init ()
{
var tbItem = new ToolbarItem { Text = "hello", Icon="wrongName" };
ToolbarItems.Add(tbItem);
PushAsync (new Issue22221 ());
}
[Preserve (AllMembers = true)]
public class Issue22221 : ContentPage
{
public Issue22221 ()
{
Content = new StackLayout {
Children = {
new Label { Text = "Hello Toolbaritem" }
}
};
}
}
#if UITEST
[Test]
public void TestItDoesntCrashWithWrongIconName ()
{
RunningApp.WaitForElement(c=>c.Marked("Hello Toolbaritem"));
RunningApp.Screenshot ("Was label on page shown");
}
#endif
}
}