-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla38723.cs
68 lines (60 loc) · 1.28 KB
/
Bugzilla38723.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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 38723, "Update Content in Picker's SelectedIndexChanged event causes NullReferenceException", PlatformAffected.All)]
public class Bugzilla38723 : TestContentPage
{
protected override void Init()
{
var label = new Label
{
Text = "NoSelected"
};
var picker = new Picker
{
Title = "Options",
ItemsSource = new[] { "option1", "option2", "option3" }
};
picker.SelectedIndexChanged += (sender, args) =>
{
label.Text = "Selected";
Content = label;
};
var button = new Button
{
Text = "SELECT"
};
button.Clicked += (sender, args) =>
{
picker.SelectedIndex = 0;
};
Content = new StackLayout
{
Children =
{
label,
picker,
button
}
};
}
#if UITEST
[Test]
public void Bugzilla38723Test()
{
RunningApp.Tap(q => q.Marked("SELECT"));
RunningApp.WaitForElement(q => q.Marked("Selected"));
RunningApp.WaitForNoElement(q => q.Marked("SELECT"));
}
#endif
}
}