Hello,

I wish to test if a method has raised an exception for a value
(something that should make the test pass) or not.

For example:

function TestNum(ch : Char) : Byte;
begin
  if UpCase(ch) in ['A'..'F', '0'..'9'] then
    ...
  else
    raise Exception.Create('Invalid char was given.');
end;

I want to test the code with Char like 'y' for example, to make sure
that it does raises the exception.


Does AssertException is the proper method for such test ?

Thanks,
Ido
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to