dotnet/winforms

Add unit test for Link label

Open

#10,679 建立於 2024年1月17日

在 GitHub 查看
 (6 留言) (1 反應) (1 負責人)C# (922 fork)batch import
help wantedtest-enhancement

倉庫指標

Star
 (4,100 star)
PR 合併指標
 (平均合併 14天 22小時) (30 天內合併 56 個 PR)

描述

Add unit tests for PR#10642

Using the following code in a .net core project reproduces issue #10515,

  • When the linkLabel.Text is null or empty, the code Application.DoEvents(); will enter an infinite loop before PR#10642
 LinkLabel linkLabel = new();
 // try to comment out  this line 'linkLabel.Text = "2";'
 // and observe the result after click the button
 linkLabel.Text = "";

this.Controls.Add(linkLabel);
this.Invalidate();
Application.DoEvents(); 

MessageBox.Show("button1_Click");

However, Application.DoEvents(); is invalid when used in Unit test, so additional tests need to be added for PR#https://github.com/dotnet/winforms/pull/10642

貢獻者指南