DataTestMethod vs TestMethod

Both attributes work because the same attributes are defined in the same namespace as the previous version of MSTest. This was done for backward compatibility.

Reference :

Taking the MSTest Framework forward with “MSTest V2”

Github: Unit Test Samples


ShreyasRmsft commented the following on GitHub:

Hi @cactuaroid DataTestMethod is not needed. Go ahead and use TestMethod with DataRows to data drive your tests. For any more doubts follow the official docs at https://github.com/microsoft/testfx-docs

https://github.com/microsoft/testfx/issues/614

https://github.com/microsoft/testfx-docs/issues/64

So, according to Microsoft, it is preferred to use TestMethod over DataTestMethod.