Skip to content

Commit 8e92078

Browse files
Ensured the failed test case
1 parent 64317de commit 8e92078

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issue32223.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,33 @@ public Issue32223()
8080
AdultTemplate = adultTemplate
8181
};
8282

83+
Label label = new Label
84+
{
85+
Text = "",
86+
AutomationId = "ReorderedLabel"
87+
};
88+
89+
90+
collectionView.ReorderCompleted += (s, e) =>
91+
{
92+
label.Text = "Success";
93+
};
94+
8395
// --- CollectionView Setup ---
8496
collectionView.SetBinding(ItemsView.ItemsSourceProperty, "People");
8597

8698
collectionView.ItemTemplate = selector;
8799

88-
Content = new Grid
89-
{
90-
Children = { collectionView }
91-
};
100+
Grid grid = new Grid();
101+
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
102+
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
103+
grid.Children.Add(label);
104+
grid.Children.Add(collectionView);
105+
106+
grid.SetRow(label, 0);
107+
grid.SetRow(collectionView, 1);
92108

109+
Content = grid;
93110
}
94111
}
95112

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32223.cs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,13 @@ public Issue32223(TestDevice testDevice) : base(testDevice)
1111
}
1212
public override string Issue => "[Android] CollectionView items do not reorder correctly when using an item DataTemplateSelector";
1313

14-
[Test, Order(1)]
14+
[Test]
1515
[Category(UITestCategories.CollectionView)]
16-
public void CanReorderWithItemDataTemplateSelector_1()
16+
public void CanReorderWithItemDataTemplateSelector()
1717
{
1818
App.WaitForElement("ReorderableCollectionView");
1919
App.DragAndDrop("David", "Charlie");
20-
VerifyScreenshot();
21-
}
22-
23-
[Test, Order(2)]
24-
[Category(UITestCategories.CollectionView)]
25-
public void CanReorderWithItemDataTemplateSelector_2()
26-
{
27-
App.WaitForElement("ReorderableCollectionView");
28-
App.DragAndDrop("David", "Alice");
29-
VerifyScreenshot();
30-
}
31-
32-
[Test, Order(3)]
33-
[Category(UITestCategories.CollectionView)]
34-
public void CanReorderWithItemDataTemplateSelector_3()
35-
{
36-
App.WaitForElement("ReorderableCollectionView");
37-
App.DragAndDrop("Charlie", "Alice");
38-
VerifyScreenshot();
20+
var expectedText = App.WaitForElement("ReorderedLabel").GetText();
21+
Assert.That(expectedText, Is.EqualTo("Success"));
3922
}
4023
}
Binary file not shown.

0 commit comments

Comments
 (0)