I noticed that the tear down always throw TargetInvocationException.
Which is the result of using reflection to invoke the tear down
methods. For example:
TearDown : System.Reflection.TargetInvocationException : Exception has
been thrown by the target of an invocation.
----> NUnit.Framework.AssertionException : Thread pool was not terminated.
Would it be better if the actual exception is reported instead of the
TargetInvocationException?
Thanks,
Kenneth
Yes, it would. :-)
NUnit systematically removes any TargetInvocationExceptions
caused by its own use of reflection - as opposed to the
code in the test or the system under test. This could be
one we missed. Would you file a bug?
Charlie
Where should I file the bug, SourceForge or Lunchpad?
It turned out to be a simple fix:
-
tearDownMethods[index].Invoke(tearDownMethods[index].IsStatic ? null :
this.Fixture, new object[0]);
+ Reflect.InvokeMethod(tearDownMethods[index],
tearDownMethods[index].IsStatic ? null : this.Fixture);
Here I attached the patch, the test case was much more involved then
the fix because I didn't find one in the project. In the mean time,
the newly added test cases also discovered another problem. When
exception occurred in the SetUp, the FailureSite was reported as Test
instead of SetUp. I commented the assertion and added a TODO there.
Cheers,
Kenneth
Create issues for both:
http://sourceforge.net/tracker/?func=detail&aid=2835061&group_id=10749&atid=110749
http://sourceforge.net/tracker/?func=detail&aid=2835060&group_id=10749&atid=110749
Cheers,
Kenneth
Kenneth