My project's codebase has a legacy method that takes a DataRow as a parameter for which I would like to create a unit test method.
How can I manually create a DataRow object to pass to the method? The System.Data.DataRow class doesn't have a public-facing constructor.
A DataRow can be created by creating a new DataTable instance, adding columns to the DataTable corresponding to the "keys" that the DataRow needs to have, and then calling
NewRow()on the DataTable. For example: