Why does my String array below give me an Error, arent they all strings???
"An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type"
[Test]
[TestCase(new string[]{"01","02","03","04","05","06","07","08","09","10"},TestName="Checking10WOs")]
public void Test(String[] recordNumber)
{
//something..
}
Best Answer
This does not answer to the title of question, however it solves your specific problem.
You might want to use
TestCaseSource
, it allows you to pass multiple test case scenarios into the same testing mechanism, and you can use it as complex structures as you like.It will figure out that the first parameter is
recordNumber
and the second istestName
see the screenshot below.
Hope this saves you some time.