Get command line arguments in unit test

In a test project in Visual Studio 2008 (Pro), I created a test project, and I want to configure project properties to give a command line argument for tests. I set the properties, but then I realized that I had no idea how to use the argument.

How do you get arguments from MSTest?

+2
source share
2 answers

The VS 2008 test is compiled into DLLs that, as far as I know, cannot directly receive command line arguments.

You can add the configuration file "app.config" for the dll and use it instead.

, mstest .config , .

...

mytest.dll
mytest.dll.config
lib.dll
lib.dll.config

lib.dll mytest.dll, , lib.dll.config , - .

+1

, GetCommandLine().

Edit: GetCommandLine() - win32-, .Net.

0

Source: https://habr.com/ru/post/1673086/


All Articles