Overriding test result in TearDown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
[Issue now tracked at https:/
NUnit version 2.5.7
Runner: Console and GUI
Feature Request:
I'd love to have the ability to override a test's result (e.g. Pass/Fail/Error) in the [TearDown] method along with the option to overwrite the error message.
Some more background:
I just started with a team that uses NUnit for running for automation testing. Given that NUnit is specifically built for unit testing, I've been surprised just how well it meets our needs. The only hangup I currently have is that we have certain classes of errors that only occur on threads other than the main thread. Without going into details, it's basically impossible for us respond to these errors on the main thread without adding code everywhere to poll if any of these errors have occurred, and if so, Assert.Fail(). Without detecting the errors at all, our code ends up asserting or throwing an exception for something else on the main thread which just ends up obfuscating the real problem in the resulting TestResult.xml file.
I understand why NUnit doesn't pick up assertions/
Changed in nunitv2: | |
status: | New → Incomplete |
Changed in nunit-3.0: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
description: | updated |
tags: | added: github |
I'm attempting to determine just what's required for this feature.
Right now you have the ability to do an Assert in the teardown method with an error reported if it fails. What is lacking for this to satisfy you?