1 year ago
#332782
Stromboli_
How can I associate datarows from datatestmethod with separate tests in Azure?
I have a method marked with attribute [DataTestMethod] and several [DataRow] attributes on the same method like so:
[DataTestMethod]
[TestCategory("MyCategory")]
[DataRow("Input1")]
[DataRow("Input2")]
[DataRow("Input3")]
public void MyDataTest(string input)
{
Console.WriteLine(input);
}
This shows up as 3 separate tests in the test explorer window of Visual Studio. How can I properly associate these to 3 separate tests in Azure test manager? Adding association simply sets the test to "Assembly.Namespace.Class.MyDataTest" with no indication as to which datarow is to be used. This results in only the first row (Input1) being executed in my release pipeline. Is there a way to associate to specific data rows, or do I need to explicitly write out separate methods for each row?
Note: running vstest.console /listtests:mytests.dll
generates a list with 3 tests in it:
The following Tests are available:
MyDataTest (Input1)
MyDataTest (Input2)
MyDataTest (Input3)
But I can't seem to get azure pipelines to run all 3 tests.
azure-devops
mstest
azure-pipelines-release-pipeline
vstest
0 Answers
Your Answer