1

I'm working on Visual Studio 2015. Output of the Data Driven Test looks something like this this

Failed TestCaseName(Data Row 0)
Failed TestCaseName(Data Row 1)
Failed TestCaseName(Data Row 3)
Passed TestCaseName(Data Row 4)

Is there a way to display a meaningfull message instead of Data Row n. Something like

Failed TestCaseName(with SQL Server data source)
Failed TestCaseName(with Oracle data source)
Failed TestCaseName(with MYSql data source)

or

Failed TestCaseName_SQLServer(Data Row 0)
Failed TestCaseName_Oracle(Data Row 1)
Failed TestCaseName_MySql(Data Row 2)

I have tried with.

TestContext.Properties["TestName"] = "TestCaseName_SQLServer"; 
TestContext.Properties["FullyQualifiedTestClassName"] = "TestCaseName_SQLServer";

But no luck. This is the same question but not answered.

Nayana Adassuriya
  • 19,806
  • 20
  • 87
  • 131

1 Answers1

0

In order to have a meaningfull message, you must use a custom data source attribute. See the answer posted for https://stackoverflow.com/a/66312973/8194898 As well, a working, demo code source is posted on github https://github.com/matei-tm/howto-demos/tree/main/MstestCustomDataSource The demo presents a mock Pass and Fail for a custom data source enter image description here

Mircea Matei
  • 446
  • 4
  • 7