abstract fun <TExpected : Throwable> toThrow(expectedType: KClass<TExpected>): IAssertionPlant<TExpected>
Use the overload with reified type parameter whenever possible.
Makes an assertion about the commonFields's subject
that it is of the expected type TExpected and reports an error if subject is null
or another type
than the expected one.
expectedType
- The expected type of the thrown Throwable.
AssertionError
- Might throw an AssertionError if the assertion fails.
IllegalStateException
- In case reporting a failure does not throw itself.
Return
This builder to support a fluent-style API.
abstract fun <TExpected : Throwable> toThrow(expectedType: KClass<TExpected>, createAssertions: IAssertionPlant<TExpected>.() -> Unit): IAssertionPlant<TExpected>
Use the overload with reified type parameter whenever possible.
Makes an assertion about the commonFields's subject that it is of the expected type TExpected and reports an error if subject is null or another type than the expected one -- furthermore it createAssertions which are checked additionally as well.
AssertionError
- Might throw an AssertionError if an assertion fails.
IllegalStateException
- In case reporting a failure does not throw itself.
Return
This builder to support a fluent-style API.