Skip to content

Create app context switch test helper #3370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulmedynski opened this issue May 21, 2025 · 0 comments · May be fixed by #3371
Open

Create app context switch test helper #3370

paulmedynski opened this issue May 21, 2025 · 0 comments · May be fixed by #3371
Assignees
Labels
Area\Tests Issues that are targeted to tests or test projects
Milestone

Comments

@paulmedynski
Copy link
Contributor

We need a helper class to properly get/set and reset the global values in LocalAppContextSwitches during testing. We currently have a bunch of reflection code duplicated in several places, and most (all?) of them aren't properly capturing current values and ensuring they get reset after the test.

I suggest we create an RAII helper that captures current values during construction, has getters to retrieve the global values, setters to manipulate the global values, uses IDisposable to reset all values back to their original state.

@paulmedynski paulmedynski added this to the 6.1-preview2 milestone May 21, 2025
@paulmedynski paulmedynski self-assigned this May 21, 2025
@paulmedynski paulmedynski added the Area\Tests Issues that are targeted to tests or test projects label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area\Tests Issues that are targeted to tests or test projects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant