Fix CultureInfo being overridden by user settings

This issue was initially found by running the tests at exercises/concept/beauty-salon-goes-global on my local machine. The tests failed locally but succeeded on the server.

I find out that the issue is new CultureInfo(string name) by default sets useUserOverride to true, which uses Windows user customized settings. This results in local tests failed on some machines with customized date time format. We should use CultureInfo.GetCultureInfo(string name) instead which gets the cached instance or creates a new instance with useUserOverride set to false.

I have opened a PR at #2296. In this PR, I also fix other exercises with the same potential issue. Please consider reopen and approve.

3 Likes