> Lets say I have some method that basically says (this is a syntex
> question so thats why I said basically):
[quoted text clipped - 16 lines]
>
> --Aryeh
If I understand what you're after correctly then this is my normal way
of acheiving it
try {
someMethodCallOrSimilarThatIWouldLikeToThrowAnException();
fail();
} catch (TheExceptionThatIWantToBeThrownHere e) {
pass();
}
I have seen it with the fail() after the catch block, which I think
would be more robust, but I haven't come across a situation that this
caused a problem in.
If you are doing lots of similar things then this can be wrapped up in a
method to simplify the test to a single line.
Hope this helps,
James
Aryeh.Friedman@gmail.com - 13 Jan 2006 16:46 GMT
Thanks... I was aware of the above techinque my question was how to
implement it as a single method (passing the statement that may or may
not throw an exception)
--Aryeh