Is posible to set nunit Category based on ValueSource?

时间:2015-09-14 16:00:07

标签: c# nunit

I have test with parameter like this:

class Test
{
   [Test, Category("somecategory")]
   public void SomeTest([ValueSource(typeof(Data), "Variants")] string variants)
   {
       // code for test
   }
}

class Data
{
   public string[] Variants()
   {
      string[] variants = new string[] { "a", "b" };
      return variants;
   }
}

I need to add Category based on ValueSource of test. If test is using variant a, it have category a. So it can be started separately in NUnit console.

0 个答案:

没有答案