You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have received a couple of requests internally and externally from users about the ability to have some of the attributes working for specific entries of parameterized tests.
Here #1043 the user is asking for the Ignore attribute to work on specific row.
Proposed Feature
Attributes cannot work on attributes so the only possibility I see is to have properties/options on the attribute. I would suggest to do the same for TestMethod to have similar behavior.
More thoughts need to be put onto designing this request but I wanted to capture the global idea.
Alternative Designs
The text was updated successfully, but these errors were encountered:
A possible workaround the users can make is something like this:
[TestMethod][Ignore]// Or TestCategory, etc..[DataRow(data1)][DataRow(data2)]publicvoidTestMethodIgnored(...)=> TestMethodCore(...);[TestMethod][DataRow(data3)][DataRow(data4)]publicvoidTestMethod()=> TestMethodCore(...);privatevoidTestMethodCore(...){// actual test logic.}
Given that the workaround is easy, we need to evaluate whether we should be pushing users to that workaround, or if we really need to make a change. And what are the downsides for the workaround, is it going to be problematic in real scenarios? etc.
For example, one downside is if the user wants to have a combination of different things.
Let's say the user wants to have 4 DataRows with all possible combinations (i.e, ignored + TestCategory, not ignored + TestCategory, ignored + not TestCategory, not ignored + not TestCategory). This means there will be 4 test methods which is unfortunate and makes this workaround less usable. But how often does such scenario happen and whether it's worth doing a public API change for it.
Evangelink
changed the title
Allows to have metadata applied to specific entries of parameterized tests
Allow to have metadata applied to specific entries of parameterized tests
Nov 22, 2024
Summary
We have received a couple of requests internally and externally from users about the ability to have some of the attributes working for specific entries of parameterized tests.
Background and Motivation
For example, in here https://developercommunity.visualstudio.com/t/testcategory-and-datarow/465295 user is requesting for
TestCategory
to be applied on a given entry and not the full method.Here #1043 the user is asking for the
Ignore
attribute to work on specific row.Proposed Feature
Attributes cannot work on attributes so the only possibility I see is to have properties/options on the attribute. I would suggest to do the same for
TestMethod
to have similar behavior.More thoughts need to be put onto designing this request but I wanted to capture the global idea.
Alternative Designs
The text was updated successfully, but these errors were encountered: