I like my unit tests to be fairly simple and easy to use. I often code the expected test results to avoid repeating the code I'm testing. In addition, I often use data-driven tests. For example, if I test the format in which the date / time is presented, I will sometimes hard code the expected string, i.e. "1/1/2000" or "1:00 PM". However, since date and time formats are culture specific and our application is localizable, the actual output may vary. However, my team is based in the USA, and therefore this is usually not a problem. Our continuous integration and build servers work with US culture information.
There is a team member who complained because he changed the date format on his development machine to manually test other date formats, and therefore there are not many tests for him. Should I use current culture information when testing outputs in unit tests or is this acceptable hard coding?
UPDATE: I set a specific locale for specific tests.
source share