How can we improve Team Services?

Allow use of DataTestMethod / DataRow in all unit testing projects

As I understand it these attributes are limited to use in WinRT/Metro and now with update 2, Windows Phone 8. It would be very helpful to be able to use them in all test projects e.g.

[DataTestMethod]
[DataRow("a", "b")]
[DataRow(" ", "a")]
public void TestMathos1(string value1, string value2)
{
Assert.AreEqual(value1 + value2, string.Concat(value1, value2));
}

1,286 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Simon VaneSimon Vane shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Robert KranenburgRobert Kranenburg shared a merged idea: Add a RowTest attribute to MSTest to facilitate parameterized tests.  ·   · 

    28 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Stoiko NeykovStoiko Neykov commented  ·   ·  Flag as inappropriate

        Downloaded pre-release Mstest v2 and adapter for it and well ... example above just do not show up in test explorer ... not wonder NUnit have 500k downloads last 6 weeks

      • NUnit has TestCasesNUnit has TestCases commented  ·   ·  Flag as inappropriate

        I have recently left MSTest over this. I am astounded this feature was never added except to, gasp, Windows Store apps??! Oh really.

      • Alfredo ChavezAlfredo Chavez commented  ·   ·  Flag as inappropriate

        It's just idiotic to think that MSTest remains stalled in the stone age while all the other (cool) guys are moving forward in bounds and leaps. Just add the feature or make XUnit part of VS for one and drop MSTest entirely.

      • John TheisenJohn Theisen commented  ·   ·  Flag as inappropriate

        This is a duplicate. Please roll these votes into the other topic as it has yet to be fully implemented.

      • John TheisenJohn Theisen commented  ·   ·  Flag as inappropriate

        And 5 more months have gone by and still this feature 1) has no reason for having been implemented only for windows store apps 2) missed the market completely by focusing on a segment that needs it less than the other segments 3) and it is YEARS behind the other major frameworks. People, let's get with this! You are forcing devs/tests to cut and paste tests and leads to reduced agility.

      • Jocke EkJocke Ek commented  ·   ·  Flag as inappropriate

        Please include the feature for all application types, it's very useful when writing tests. Should be included in a unit test framework.

      • Kevin AungKevin Aung commented  ·   ·  Flag as inappropriate

        This would help a lot. I really like mstest but thinking about switching to NUnit because they have this feature.

      • Simon VaneSimon Vane commented  ·   ·  Flag as inappropriate

        We ended up switching to nunit. There are far too many features missing from mstest to bother persevering with it.

      • AA commented  ·   ·  Flag as inappropriate

        People have been requesting this feature for years.
        Its a bit of a slap in the face to see it in Wart/Metro and not have it for real .Net projects.

      • ThwaitesyThwaitesy commented  ·   ·  Flag as inappropriate

        About 6 months ago I created a project called MSTestHacks - The main feature of this project is the RuntimeDataSource stuff. Basically you point the [DataSource] attribute to a property, field or method name that returns an IEnumerable and at run time it will loop through the collection just like normal. (Think NUnit's TestCaseSource)

        We use it in production for over 20 projects now and its extremely solid.

        https://github.com/Thwaitesy/MSTestHacks

      ← Previous 1

      Feedback and Knowledge Base