summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2222.cs
blob: fc3fa811f429c7e7ddcdf4ad2cc70a047187cf03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using NUnit.Framework;
using Xamarin.UITest;
#endif

namespace Xamarin.Forms.Controls
{
	[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

	}
}