lundi 26 novembre 2018

TestContext is null when we run from console application in VisualStudio

We created a console application and added the test classes and methods into them. And when ever we wanted to run the test cases, we will set the project properties like(as to run the test case)

By Going to project properties window -> CommandLineArguments -> "name of the exe" "TestCaseName"

Example: TestProject.exe CommonScenario.Product.TestProduct

And then click on "debug" button which is available in VS. If I'm doing in this way, TestContext is coming as null in setup method. But when I'm debugging/run through VisualStudio Test Explorer then I'm able to get the TestContext. How can I get the value of the "TestContext" even If I run through CommandLineArguments?

Aucun commentaire:

Enregistrer un commentaire