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

后端 未结 6 1030
清酒与你
清酒与你 2021-02-02 07:33

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 s

6条回答
  •  清歌不尽
    2021-02-02 07:44

    You may set

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

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

提交回复
热议问题