private T GetTestDataObject <T>(TestCaseWrapper <T> testCaseWrapper, TestSourceWrapper <DataTable, DataRow> testSource) where T : new() { var testCase = testCaseWrapper.Initialize.Invoke(); for (int i = 0; i < testSource.Table.Columns.Count; i++) { var value = testSource.Row[i]; var key = testSource.Table.Columns[i].ColumnName; testCaseWrapper.SetupValue.Invoke(testCase, key, value); } return(testCase); }
private T GetTestDataObject <T>(TestCaseWrapper <T> testCaseWrapper, TestSourceWrapper <ExcelWorksheet, int> testSource) where T : new() { var testCase = testCaseWrapper.Initialize.Invoke(); var endColumnIndex = testSource.Table.Dimension.End.Column; for (int columnIndex = LabelDataRow; columnIndex <= endColumnIndex; columnIndex++) { var labelCell = testSource.Table.Cells[LabelDataRow, columnIndex]; var key = labelCell.Value.ToString(); var value = testSource.Table.Cells[testSource.Row, columnIndex].Value; testCaseWrapper.SetupValue.Invoke(testCase, key, value); } return(testCase); }