summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
new file mode 100644
index 00000000..e7d99b06
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
@@ -0,0 +1,59 @@
+´╗┐using System;
+
+using Xamarin.Forms.CustomAttributes;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.Bugzilla, 32230, "isPresentedChanged raises multiple times")]
+ public class Bugzilla32230 : TestMasterDetailPage // or TestMasterDetailPage, etc ...
+ {
+ Label _lblCount;
+ Button _btnOpen;
+ Button _btnClose;
+ int _count;
+
+ protected override void Init ()
+ {
+ _lblCount = new Label { Text = _count.ToString (), AutomationId = "lblCount" };
+ _btnOpen = new Button { Text = "Open", AutomationId = "btnOpen",
+ Command = new Command (() => {
+ IsPresented = true;
+ })
+ };
+ _btnClose = new Button { Text = "Close", AutomationId = "btnClose",
+ Command = new Command (() => {
+ IsPresented = false;
+ })
+ };
+
+ Master = new ContentPage {
+ Title = "Master",
+ Content = new StackLayout { Children = { _lblCount, _btnClose } }
+ };
+
+ Detail = new NavigationPage (new ContentPage { Content = _btnOpen });
+ IsPresentedChanged += (object sender, EventArgs e) => {
+ _count++;
+ _lblCount.Text = _count.ToString();
+ };
+ }
+
+#if UITEST
+ [Test]
+ public void Bugzilla32230Test ()
+ {
+ RunningApp.Tap (q => q.Marked ("btnOpen"));
+ Assert.AreEqual ("1", RunningApp.Query (q => q.Marked ("lblCount"))[0].Text);
+ RunningApp.Tap (q => q.Marked ("btnClose"));
+ RunningApp.Tap (q => q.Marked ("btnOpen"));
+ Assert.AreEqual ("3", RunningApp.Query (q => q.Marked ("lblCount"))[0].Text);
+ }
+#endif
+ }
+}