-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue4714.cs
73 lines (64 loc) · 1.51 KB
/
Issue4714.cs
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Github5000)]
[Category(Core.UITests.UITestCategories.Gestures)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 4714, "SingleTapGesture called once on DoubleTap", PlatformAffected.UWP)]
public class Issue4714 : TestContentPage
{
const string InitialText = "Click Me To Increment";
public Command TapCommand { get; set; }
protected override void Init()
{
int i = 0;
var tapGesture = new TapGestureRecognizer { NumberOfTapsRequired = 1 };
tapGesture.SetBinding(TapGestureRecognizer.CommandProperty, "TapCommand");
var label = new Label()
{
AutomationId = InitialText,
HorizontalOptions = LayoutOptions.Center,
Text = InitialText,
GestureRecognizers =
{
tapGesture
}
};
TapCommand = new Command(() =>
{
i++;
label.Text = $"{InitialText}: {i}";
});
Content = new ContentView()
{
Content = new StackLayout()
{
Children =
{
label
}
}
};
BindingContext = this;
}
#if UITEST
[Test]
public void Issue4714Test()
{
RunningApp.WaitForElement(InitialText);
RunningApp.DoubleTap(InitialText);
RunningApp.Tap(InitialText);
RunningApp.Tap(InitialText);
RunningApp.WaitForElement($"{InitialText}: 4");
}
#endif
}
}