ExpectedException specification
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Confirmed
|
Medium
|
Unassigned |
Bug Description
[Issue now tracked at https:/
I subclassed ExpectedException attribute passing to super constructor AssertionException type.
Now if I attibute my test method with both my subclass and ExpectedExcepti
- R# runner interpretes all attributes in sequence so a test method body that passes is toggled to failure by the first ExpectedException attribute then the failure is toggled back to pass by the next ExpectedException attribute.
- Nunit 2.5.3 gui-runner seems to interpret just the first one
for:
<Test()> <ObservedBehavi
Public Sub ObservedBehavio
yielding:
Observed behaviour has been changed. Please balance the value of the change with compatibility breach costs.
Originally observed behaviour: Code generator produces duplicates.
NUnit.
while for
<Test()> <ExpectedExcept
Public Sub ObservedBehavio
returning:
NUnit.
The documentation deserves a clarification.
Changed in nunitv2: | |
status: | New → Incomplete |
Changed in nunit-3.0: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
no longer affects: | nunitv2 |
tags: |
added: github removed: feature framework |
description: | updated |
It is not possible to universally determine textual order of attributes based on the metadata alone. Since NUnit tests are driven by the metadata, and not the source code, there is no way to accomplish what you want. (Note: it could be done in a framework- dependent, version-dependent manner, but not across all frameworks and versions)
Further, NUnit expects and allows only _one_ ExpectedExcepti onAttribute on a method. The approach of deriving a new attribute from ExpectedException does not cause the new attribute to recognized by NUnit at all.
Charlie
PS: Sorry for the delay, this was inadvertently marked Incomplete some time ago and I only now re-examined it.