Skip to content
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

Set the DefaultThreadCurrentUICulture to a specific culture, asserted error language consistency #1150

Merged

Conversation

LucTremblay
Copy link
Contributor

Problem

#1145

Solution

By setting DefaultThreadCurrentUICulture to CultureInfo.InvariantCulture, in the base class of the unit tests, it ensure that the asserted build error text and actual error text will be in the same language

…e if the current computer culture is not en-US a lot of asserts will fail, because the language of the error might not be english.
@@ -28,6 +29,7 @@ public class ConverterTestBase

public ConverterTestBase(string rootNamespace = null)
{
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have: Haven't had need to try this yet, but may be worth trying putting in a ModuleInitializer so it definitely covers the whole test suite rather than some tests running with it and some without.

@GrahamTheCoder GrahamTheCoder merged commit abea701 into icsharpcode:master Nov 9, 2024
2 checks passed
@GrahamTheCoder
Copy link
Member

Thanks, I'll try to move it to a module initializer now

@LucTremblay LucTremblay deleted the defaultThreadCurrentUICulture branch November 9, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants