unit testing - Visual Studio data-driven tests -
i'm using textcontext property access current row in excel file. test repeated rows. possible access rows in single step? rows related, hence me 1 sheet should complete run.
edit: add code requested:
int result = this.textcontext.rows[0]["globalresult"]; foreach(var row in this.testcontext.rows.skip(1)) { componenttotest.eval(convert.toint32(row["a"]), convert.toint32(row["b"])); } assert.areequal(result, componenttotest.result);
and file appear this:
globalresult, a, b 100, null, null null, 1, 5 null, 3, 6 ... , on
thank much
instead of using data driven tests, why don't read excel file , iterate through rows? take @ this question on how read excel file's contents. can iterate through rows in test without having use mstest data driven attributes.
cheers. jas.
Comments
Post a Comment