TestContext.DataRow is not supported

29 Views Asked by At

I am trying to convert a code from an old version of C# to a new one. Here is a minimal example:

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Example
{
class Program
{
static void Main()
{
TestContext testContext = new();

object x = testContext.DataRow.Item(2);
}
}
}

A compilation error will be raised, as DataRow property does not exist in new versions of C#. How to handle it?

0

There are 0 best solutions below