microsoft / testfx-docs

Docs for MSTest V2 test framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DataTestMethod vs TestMethod

jnyrup opened this issue · comments

I discovered today that [DataRow] can be used with together with [TestMethod], where I had the understanding that [DataTestMethod] was required.

Searching both the source code and docs, I'm a bit confused.

I've find no practical difference between the two attributes in the source code, but the documentation for [DataTestMethod] says that it is intended for data driven tests.
Then the examples for [DataRow] uses [TestMethod].

This seems accurate. Some MSTest V1 documentation seems to indicate [TestMethod] can be used. But many sources on V2 seems to say that [DataTestMethod] should be used

In this PR of testfx it was reworked and now DataTestMethodAttribute inherits from TestMethodAttribute and doesn't change anything. Should nowadays be the same in usage.

Thanks for pointing this out. I have a PR to fix this issue.