Consider a function that does some exception handling based on the arguments passed:
List range(start, stop) {
i
I used the following approach:
First you need to pass in your method as a lambda into the expect function:
expect(() => method(...), ...)
Secondly you need to use throwsA in combination with isInstanceOf.
throwsA makes sure that an exception is thrown, and with isInstanceOf you can check if the correct Exception was thrown.
Example for my unit test:
expect(() => parser.parse(raw), throwsA(isInstanceOf()));
Hope this helps.