I know I can do this when I run test via command line :
dotnet test myproject.csproj /p:IsTest=true
What if I want to pass that
/p:IsTest=true when I run test via Visual studio's Test Explorer? How can I do this?
What I want to do is, selectively excluded some portion of my code from build process only when I want to run Test
in myproject.csproj :
<DefineConstants Condition=" '$(IsTest)' == 'true' ">$(DefineConstants);TEST</DefineConstants>
This will allow me to put any codes behind
#if TEST ... #endif or
#if !TEST ... #endif
So I want to know if I can apply this concept when I run test from the Visual Studio itself rather than run test in cmd myself.