Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExpectedException specification #18

Closed
CharliePoole opened this issue Oct 19, 2013 · 2 comments
Closed

ExpectedException specification #18

CharliePoole opened this issue Oct 19, 2013 · 2 comments

Comments

@CharliePoole
Copy link
Contributor

I subclassed ExpectedException attribute passing to super constructor AssertionException type.

Now if I attibute my test method with both my subclass and ExpectedException(AssertionException) I get runner and attribute order dependent behaviour:

  • 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()> <ObservedBehaviour("Code generator produces duplicates.")> <ExpectedException(GetType(AssertionException))> _
Public Sub ObservedBehaviourAfterChangeTest()

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.Framework.AssertionException was expected

while for

<Test()> <ExpectedException(GetType(AssertionException))> <ObservedBehaviour("Code generator produces duplicates.")> _
Public Sub ObservedBehaviourAfterChangeTest()

returning:

NUnit.Framework.AssertionException was expected

The documentation deserves a clarification.

See discussion at https://bugs.launchpad.net/nunit-3.0/+bug/532536

@CharliePoole CharliePoole added this to the 3.0 milestone Mar 2, 2014
@CharliePoole CharliePoole removed this from the 3.0 milestone Mar 7, 2014
@simoneb
Copy link
Contributor

simoneb commented Mar 19, 2014

Closed as invalid as this is no longer relevant.

@simoneb simoneb closed this as completed Mar 19, 2014
@CharliePoole
Copy link
Contributor Author

... because we no longer have ExpectedException!

Just as an explanation for the original requester. :-)

simoneb added a commit that referenced this issue Sep 1, 2014
@rprouse rprouse modified the milestone: Closed Without Action Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants