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

后端 未结 6 1133
清酒与你
清酒与你 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 08:02

    There isn't a setting similar to the one in web.config that will work in your case.

    You could try setting it for each thread as suggested by the other answers here.

    Alternatively if you are using resources created in VS.NET, the code generation creates a static property on the Resource class called 'Culture'. You could set that in your unit test's Suite startup method. That will apply to all the tests that you run.

提交回复
热议问题