summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-03-22 13:02:25 -0700
committerJason Smith <jason.smith@xamarin.com>2016-03-22 16:13:41 -0700
commit17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch)
treeb5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
downloadxamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip
Initial import
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
+ }
+}