问题
I want to create data parameter name and values data in dictionary
Dictionary<string, List> //string is ParameterName, List is Parameter Values
Dictionary<string, List<string>> parameterNameValues = new Dictionary<string, List<string>>();
DataTable parametersTable = testCase.DefaultTableReadOnly;
DataRowCollection dr = parametersTable.Rows;
DataColumnCollection dc = parametersTable.Columns;
for (int i = 0; i < dc.Count; i++)
{
string pName = dc[i].ColumnName;
List<string> pValue = new List<string>();
for (int j = 0; j < dr.Count; j++)
{
pValue.Add(dr[j].ItemArray[i].ToString());
}
parameterNameValues.Add(pName, pValue);
}
above code contains bugs. Can you plz share code?
来源:https://stackoverflow.com/questions/62572101/test-case-parameter-values-and-shared-parameter-values