سؤال

How can I get the data from a row in the current running test? this answers how to get the iteration number ie 0,1,2.. of the running test:

int currentIteration = TestContext.DataRow.Table.Rows.IndexOf(TestContext.DataRow);

However, I would like to get the actual data in this row.

هل كانت مفيدة؟

المحلول

Simpler than I expected. this is for a single column table, so the ItemArray will always be 0:

string currentIterationData = TestContext.DataRow.ItemArray[0].ToString();
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top