-
Notifications
You must be signed in to change notification settings - Fork 155
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
Question about expecting exceptions #127
Comments
To clarify, this would allow: [<Property(ExpectedException="exn")>]
let ``failure`` (e: exn) =
Failure e |> dematerialize vs [<Property>]
let ``failure`` (e: exn) =
Prop.throws<exn, _> (lazy (Failure e |> dematerialize)) |
If this idea is the same as MSTest's I don't think it'd be a good idea to perpetuate a bad idea when there are better options around. BTW, you should consider looking at Unquote for expressing assertions. |
Thanks @ploeh, I'll look into that. I tried using Unquote but it had some limitations that meant it wasn't an option for me. |
BTW, I hope the above comment wasn't too crass. I was on my way out the door when I wrote it, but now that I reread it, I think it looks a little impolite. If so, please accept my apologies. |
Not at all! Nice to hear from you. |
Yeah, not a fan of that suggestion either. Been bitten a few too many times by overly broad attribute-based ExpectedException mechanisms. Most unit testing frameworks should have support for somethink like |
Would it possible to expect exceptions via attributes?
Borrowing from NUnit, this might look like:
[<Property(ExpectedException="exn")>]
or
The text was updated successfully, but these errors were encountered: