Previous | Next
Topic: Do we have a utAssert to check for an exception
Conf: 550, Msg: 41887
From: Chris Rimmer (chris@nominet.org.uk)
Date: 3/5/01 01:19 AM
Do we have a utAssert to check for an exception Chris Rimmer chrisrimmer chris.rimmer@tessella.co.uk
Well I wrote one and have submitted it to Steven. This means it should be in the next release, but since I think he is probably putting the finishing touches to his new book (due next month) you may have to wait a while.
Meanwhile, you can achieve the same effect by doing the following to check that the correct value of SQLCODE is obtained:
BEGIN
MyPackage.MyProcedure;
utAssert.this('No Exception', FALSE);
EXCEPTION
WHEN OTHERS THEN
utAssert.eq('Exception', SQLCODE,
MyExpectedValue);
END;
Alternatively, if you are using named exceptions you change the exception block to look for the correct exception instead...
Chris