The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
TestContext::DataRow Property
When overridden in a derived class, gets the current data row when test is used for data driven testing.
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
The DataRow property returns values for the current row by column. This will return data identified by column. The column is identified either by name, as in the following example, or by its index location. Using the sample data table shown in following example section, an index identifier of DataRow[0] will return the value for the Name column in Table1.
Legacy Code Example
The following code contains the class and method to test.
The following test will pass. It uses the sample.mdb access database that contains Table1 with the following data.
Name | Balance | Amount |
|---|---|---|
Becky | 100 | 25 |
John | 70 | 60 |
Larry | 75 | 71.25 |
Stephanie | 159 | 158 |
Mr. Bryan Walton | 11.99 | 11.22 |
Show: