You know you can use SetCategory multiple times, right?

** Project changed: nunitv2 => nunit-3.0

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/1091485

Title:
  The TestCaseSourceAttribute should allow to set multiple categories
  using .SetCategory or .SetCategories

Status in NUnit Test Framework:
  Triaged

Bug description:
  Hi NUnit,

  Use of the TestCaseSourceAttribute together with yield is a great way
  to generate test vectors. However, in some cases, a certain test may
  have multiple categories applied, in my case for example
  'SerialPortAIsAvailable' + 'SerialPortBIsAvailable' +
  'SerialPortsAreInterconnected'. This currently cannot be achieved
  using .SetCategory() because that method only takes a single string as
  an argument. I therefore suggest to either provide a .SetCategory()
  method that takes a string array as an argument, or the add a new
  method .SetCategories() that does the same.

  Example code:
  foreach (KeyValuePair<TransmissionType, string> kvp in 
TransmissionTypes.GetItems)
  {
      yield return (new TestCaseData(kvp.Key, SingleLineCommand, 
1).SetCategory(kvp.Value).SetName(kvp.Key + "_SingleLineTransmission"));
      yield return (new TestCaseData(kvp.Key, DoubleLineCommand, 
1).SetCategory(kvp.Value).SetName(kvp.Key + "_DoubleLineTransmission"));
     yield return (new TestCaseData(kvp.Key, DoubleLineCommand, 
2).SetCategory(kvp.Value).SetName(kvp.Key + "_DoubleLineDoubleTransmission"));
     ...

  Currently using:
  > NUnit 2.5.10 (not yet upgraded to 2.6.2 due to the fact that the upgrade 
lead to issues with .NET 3.5)
  > Gui Runner

  Best regards & Thanks a lot for NUnit being such a great tool!
  Matthias

  YAT - Yet Another Terminal.
  Visit YAT at http://sourceforge.net/projects/y-a-terminal/.
  Contact YAT by mailto:y-a-termi...@users.sourceforge.net.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunit-3.0/+bug/1091485/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~nunit-core
Post to     : nunit-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~nunit-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to