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

Ensure Consistent Numeric Formatting in Unit Tests Across Different Locales #49

Merged

Conversation

SergeyFM
Copy link
Contributor

Overview
This pull request introduces a modification to the Format_Numeric_Fields unit test to set the CultureInfo.CurrentCulture to CultureInfo.InvariantCulture. This change ensures that the numeric formatting remains consistent, regardless of the regional settings of the system on which the tests are executed.

Background
Unit tests often fail across different environments due to variations in culture settings, especially when it comes to numeric, date, and time formats. Such inconsistencies can lead to failed tests on some systems while passing on others, which is highly undesirable for maintaining stable and reliable build processes.

Request for Review
I request a review from the team to ensure that this approach aligns with our overall testing strategy and to confirm the robustness of the test modifications.

…ormatting across different environments. This is crucial because the output of string formatting for numbers can vary based on the machine's locale settings. Using the invariant culture ensures that the format "12,345.00" will be consistent regardless of the regional settings of the system on which this test runs.
Copy link
Owner

@antonmihaylov antonmihaylov left a comment

Choose a reason for hiding this comment

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

That makes perfect sense to me, thank you @SergeyFM!

@antonmihaylov antonmihaylov merged commit 5bf1f56 into antonmihaylov:master May 12, 2024
1 check passed
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