summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla58406.cs
blob: 3a31ca33fda7f6d72d24bd521cf6f212cb4e72bc (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
51
52
53
54
55
56
57
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

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

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
	[Category(UITestCategories.Effects)]
	[Category(UITestCategories.Label)]
#endif

	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 58406, 
		"Effect is never attached to Label, but is attached to Label subclass (Android)", PlatformAffected.Android)]
	public class Bugzilla58406 : TestContentPage
	{
		public const string EffectName = "_58406Effect";
		const string InitialText = "_58406";
		const string ReversedText = "60485_";

		[Preserve(AllMembers = true)]
		public class _58406Effect : RoutingEffect
		{
			public _58406Effect() : base($"{Issues.Effects.ResolutionGroupName}.{EffectName}")
			{
			}
		}

		protected override void Init()
		{
			var label = new Label { Text = InitialText };
			label.Effects.Add(Effect.Resolve($"{Issues.Effects.ResolutionGroupName}.{EffectName}"));

			Content = new StackLayout
			{
				Padding = new Thickness(0, 20, 0, 0),
				Children =
				{
					label
				}
			};
		}

#if UITEST 
		[Test]
		public void EffectAppliesToLabel()
		{
			RunningApp.WaitForElement(ReversedText);
		}
#endif
	}
}