lundi 11 décembre 2017

Visual Code Run a test method via Control + . or right click?

AFAIK, to run a specific test command is this

dotnet test --logger "trx;LogFileName=D:\Temp\test-explorer-JDX14N\Results.trx" --filter FullyQualifiedName~test_method

The above is what I saw from the terminal when i ran a test with Test Explorer extension. I've tried replacing the test_method name with a different test method and it worked. And if I replace the test_method with the test class it actually run all the tests in that class.

I don't see why I can't right click a test method/class or control + . on a method/class and have something pick up the method name and run with with the above command.

Is there a way for me to do this? i.e:

[Test]
public void TestMethod_Scenario_ExprectedResult() { ... }

control + . or right click the method or highlight the method then run test then in the terminal it'll replace test_method with the selected test method, like below.

dotnet test --logger "trx;LogFileName=D:\Temp\test-explorer-JDX14N\Results.trx" --filter FullyQualifiedName~TestMethod_Scenario_ExprectedResult

Aucun commentaire:

Enregistrer un commentaire