Skip to content

Commit ee675d3

Browse files
authored
Update ListView_Click_On_Second_Column_Does_Not_Alter_CheckBoxesAsync to add judgment and InvokeAsync (#13626)
* Update ListView_Click_On_Second_Column_Does_Not_Alter_CheckBoxesAsync to add judgment and InvokeAsync
1 parent 7069b0a commit ee675d3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/test/integration/UIIntegrationTests/ListViewTests.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,21 @@ await RunTestAsync(async (form, listView) =>
545545
Assert.False(item.Selected);
546546
}
547547

548+
await form.InvokeAsync(() =>
549+
{
550+
listView.Update();
551+
listView.Refresh();
552+
Application.DoEvents();
553+
});
554+
555+
Assert.True(listView.Items.Count > 0,
556+
$"Expected ListView to contain at least one item, but found {listView.Items.Count}.");
557+
Assert.True(listView.Items[0].SubItems.Count > 1,
558+
$"Expected first item to have more than one subitem, but found {listView.Items[0].SubItems.Count}.");
559+
548560
Point listViewCenter = GetCenter(listView.RectangleToScreen(listView.Items[0].SubItems[1].Bounds));
549561
await MoveMouseAsync(form, listViewCenter);
562+
550563
await InputSimulator.SendAsync(
551564
form,
552565
inputSimulator => inputSimulator.Keyboard.KeyDown(VIRTUAL_KEY.VK_SHIFT)
@@ -557,7 +570,7 @@ await InputSimulator.SendAsync(
557570
form,
558571
inputSimulator => inputSimulator.Mouse.LeftButtonClick()
559572
.Keyboard.KeyUp(VIRTUAL_KEY.VK_SHIFT));
560-
await form.InvokeAsync(() => { });
573+
561574
foreach (ListViewItem item in listView.Items)
562575
{
563576
Assert.Equal(0, item.StateImageIndex);

0 commit comments

Comments
 (0)