dotnet / dotnet/winforms

Add unit test for Link label

Open
#10,679 6 comments 1 reaction 1 assignee Claimed by @adeoyeenocholamilekan View on GitHub
help wanted test-enhancement
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

Add unit tests for PR#[10642](https://github.com/dotnet/winforms/pull/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](https://github.com/dotnet/winforms/pull/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.