2

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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.