public static assertThrows<TYPE = Exception>(block as Object) as Void:
Verifies that executing the lambda raises an exception.
When TYPE is omitted, any exception type is accepted. When TYPE is provided, the raised exception must match it.
| Parameter | Description |
|---|---|
block | The lambda to execute. |
import klyn.unittest
Assert.assertThrows(lambda (): Int("abc"))
Assert.assertThrows<TypeError>(lambda (): Char(-1))