How can I "expect an exception" in unit testing? Use AssertAction?

Using DUnit in Delphi, if I wanted to make sure calling a function with a certain parameter would throw an exception, I could set ExpectedException and verify the error was raised.

How do I accomplish this using EUnit?

I saw Assert.Throws but am not sure how to use it. I am thinking that if I could figure out how to declare an AssertAction, it would make sense.

Thanks,
David Cornelius

Something like:

Assert.Throws(-> begin
     var r := new List<String>;
     r[0] := 'test';
  end, typeof(ArgumentOutOfRangeException));

should work. Basically put the code in a lambda/anonymous method

Thank you very much! Perfect!