Test Case Parameter values and shared parameter values

£可爱£侵袭症+ 提交于 2020-06-29 03:49:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!