klyn.unittest.Assert.assertFails
method
public static assertFails<RESULT = Void>(notnull block as () -> RESULT) as Void
Description

Verifies that invoking a function or lambda without parameters raises an exception. The callable's return type is inferred and its result is ignored.

Parameters
ParameterDescription
blockThe parameterless function or lambda to invoke once.
Throws
  • AssertionError If the callable does not raise an exception.
Example
import klyn.unittest

Assert.assertFails(lambda (): Int("abc"))