MbUnit has a great attribute: MultipleCultureAttribute.
I am wondering if there is an easy way to do this in MSTest? So far, the best I can come up with is:
- Externalizating the actual test code to a private method
- Saving the current culture
- Setting the culture and calling the private method (repeated for each culture)
- And finally, reverting to the original culture
At best, it can be described as ugly … and verbose.
The simplest approach may be to use an anonymous delegate, however keep in mind that MSTest will treat this as a single test so it may be difficult to distinguish results for different cultures.
eg. Rough code for anonymous delegate approach.