summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs75
1 files changed, 75 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs
new file mode 100644
index 00000000..e45e6bb3
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs
@@ -0,0 +1,75 @@
+´╗┐using System;
+using System.Collections.Generic;
+
+using Xamarin.Forms;
+using Xamarin.Forms.CustomAttributes;
+
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.Bugzilla, 26032, " ListView ItemTapped doesn't get called for the selected item ", PlatformAffected.iOS)]
+ public partial class Bugzilla26032 : TestContentPage
+ {
+ #if APP
+ public Bugzilla26032 ()
+ {
+
+ InitializeComponent ();
+ var data = new[] { "1", "2", "3", "4", "5" };
+ var dataContext = new[] { "1 Context", "2 Context", "3 Context", "4 Context", "5 Context" };
+ List1.ItemsSource = data;
+ List2.ItemsSource = dataContext;
+ }
+
+
+ public void OnItemTapped(object sender, ItemTappedEventArgs e)
+ {
+ Log.Text = string.Format("Item '{0}' tapped\n{1}", e.Item, Log.Text);
+ }
+
+ public void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
+ {
+ Log.Text = string.Format("Item '{0}' selected\n{1}", e.SelectedItem, Log.Text);
+ }
+
+ #endif
+
+ protected override void Init ()
+ {
+ }
+
+
+ #if UITEST
+ [Test]
+ public void SelectedItemTap ()
+ {
+ var id = "1";
+ var idContext = "1 Context";
+ var initalLog = "Item '{0}' tapped\nItem '{0}' selected\n";
+
+ var forId1 = string.Format (initalLog, id);
+ RunningApp.WaitForElement (q => q.Marked (id));
+ RunningApp.Tap (q => q.Marked (id));
+ RunningApp.WaitForElement (q => q.Text (forId1));
+ RunningApp.Tap (q => q.Marked (id));
+ forId1 = string.Format ( "Item '{0}' tapped\n" + initalLog, id);
+ RunningApp.WaitForElement (q => q.Text (forId1));
+
+ var forIdContext = string.Format (initalLog, idContext);
+ RunningApp.WaitForElement (q => q.Marked (idContext));
+ RunningApp.Tap (q => q.Marked (idContext));
+ RunningApp.WaitForElement (q => q.Text (forIdContext + forId1));
+ RunningApp.Tap (q => q.Marked (idContext));
+ forIdContext = string.Format ( "Item '{0}' tapped\n" + initalLog, idContext);
+ RunningApp.WaitForElement (q => q.Text (forIdContext + forId1));
+ }
+ #endif
+ }
+}
+