dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.28k stars 954 forks source link

Define new scopes for AppContext switches for use in tests #11536

Open Tanya-Solyanik opened 2 weeks ago

Tanya-Solyanik commented 2 weeks ago
  1. replace use cases of SetLocalAppContextSwitchValue in tests with custom scope for each switch see BinaryFormatterScope example.
  2. Replace use cases of TestAccessor like this one - https://github.com/dotnet/winforms/blob/29528171490190df28fd4afc89dee271ebfef68b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/Dpi/FormDpiTests.cs#L111 with AppContext switch scopes as well
elachlan commented 1 week ago

@Tanya-Solyanik can we resolve this now? I am not sure if the PR covered everything. I thought I got all the usages, but could be wrong.