Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# How can I force Localization Culture to en-US for tests project

How to specify concrente Localization Culture for tests project in C# in VS2008? I'm building Asp .Net MVC app that has nonstandard culture specified in web.config but how to set the same culture for unit tests for that project?

like image 861
mgamer Avatar asked Feb 15 '11 08:02

mgamer


1 Answers

You may set

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");  

in method that is marked as "test initializer" in your unit testing framework.

like image 90
Tony Kh Avatar answered Sep 20 '22 16:09

Tony Kh