dotnet / dotnet/winforms

Integration Tests which make use of `ControlTestBase` can erroneously pass when an exception is present

Open
#8,455 8 comments 0 reactions 0 assignees View on GitHub
test-bug
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

Add the following test to `System.Windows.Forms.UI.IntegrationTests`. It should fail as an exception is thrown. But it passes.

```csharp
[WinFormsFact]
public async Task Special_Test()
{
using Form form = new();
form.Shown += (object? sender, EventArgs e) => { throw new Exception("test"); };
await RunFormWithoutControlAsync(() => form, async (form) =>
{
await MoveMouseAsync(form, new Point(0, 0), false);
form.Close();
});
}
```

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.