infix fun <E, T : Result<E>> Expect<T>.toBe(success: success): Expect<E>
Expects that the subject of the assertion (a Result) is a Success and returns an Expect for the inner type E.
AssertionError
- Might throw an AssertionError if the given assertion is not a success.
Return
The newly created Expect if the given assertion is success
Since
0.12.0
infix fun <E, T : Result<E>> Expect<T>.toBe(success: SuccessWithCreator<E>): Expect<T>
Expects that the subject of the assertion (a Result]) is a Success and that it holds all assertions the given SuccessWithCreator.assertionCreator creates.
Use the function success { ... }
to create a SuccessWithCreator.
AssertionError
- Might throw an AssertionError if the given assertions are not success.
Return
An Expect for the current subject of the assertion.
Since
0.12.0