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.
@milbrandt Shouldn't someone update the docs:
https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest#add-more-features
and then close this issue
Thanks for pointing this out. I have a PR to fix this issue.