Most of the applications I’m building should support multiple languages and cultures. This means that I also need to test my application code taking into account this into account.
In XUnit, there is no out-of-the-box way to change the culture of your unit test. However XUnit is easy to extend and you can even find a UseCultureAttribute example that exacty provides the functionality I need.
Here is an example where I used this attribute to test if my validation messages are translated correctly: