← Back to team overview

nunit-core team mailing list archive

[Bug 901629] Re: TestCaseData Exception

 

Interesting idea. Another alternative would be to use a constraint as a
second argument. I'm putting this on the wishlist for new features.

** Changed in: nunit-3.0
       Status: New => Triaged

** Changed in: nunit-3.0
   Importance: Undecided => Wishlist

-- 
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
https://bugs.launchpad.net/bugs/901629

Title:
  TestCaseData Exception

Status in NUnit Test Framework:
  Triaged

Bug description:
  The following is possible: new TestCaseData
  (...).Throws(typeof(MyException))

  But what I want to do is to spezify other additional conditions to the exception.
  This might be a Assert on the message text or a user defined property of the exception, something like an error number.

  I don't know about the right way, but perhaps it is possible to add a
  additional parameter to throws with a class, that is derived from an
  interface like this (and the method is called, if the exception has
  the right type:

  interface IExceptionCompare
  {
    bool Match(Exception e);
  }

  Hmm, perhaps this could be also used instead of the type, so the function also test if the right type.
  Throws (IExceptionCompare comparer){ ... }

  internal the current implementation could be adapted to use this
  interface also.

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


References