summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue181.cs
blob: 3cdfbfe968f24c7208d0bea4a10f15085cd28946 (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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using NUnit.Framework;
using Xamarin.UITest;
using Xamarin.Forms.Core.UITests;
#endif

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 181, "Color not initialized for Label", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
	public class Issue181 : TestContentPage
	{
		protected override void Init ()
		{
			Title = "Issue 181";
			Content = new Frame {
				OutlineColor = Color.Red,
				BackgroundColor = new Color (1.0, 1.0, 0.0),
				Content = new Label {
					Text = "I should have red text",
					TextColor = Color.Red,
					BackgroundColor = new Color (0.5, 0.5, 0.5),
#pragma warning disable 618
					XAlign = TextAlignment.Center,
#pragma warning restore 618

#pragma warning disable 618
					YAlign = TextAlignment.Center
#pragma warning restore 618
				}
			};
		}

#if UITEST
		[Test]
		[Category(UITestCategories.ManualReview)]
		[UiTest (typeof(Label), "TextColor")]
		public void Issue181TestsLabelShouldHaveRedText ()
		{
			RunningApp.WaitForElement (q => q.Marked ("I should have red text"));
			RunningApp.Screenshot ("Label should have red text");
		}
#endif
	}
}