abstract fun <T, R> unreported(container: AssertionContainer<T>, transformation: (T) -> R): Expect<R>
(source)
Changes to a new subject according to the given transformation without showing it in reporting and returns a new Expect for the new subject.
Explained a bit more in depth: it creates a new Expect incorporating the given transformation whereas the new Expect delegates assertion checking to the given container - the change as such will not be reflected in reporting.
This method is useful if you want to make feature assertion(s) but you do not want that the feature is shown up
in reporting. For instance, if a class can behave as another class (e.g. Sequence::asIterable
) or you want to
hide a conversion (e.g. Int::toChar
) then you can use this function.
Notice, in case the change to the new subject is not always safe (you assert so but it does not have to be), then you should use reported so that the assertion is reflected in reporting.
container
- the assertion container with the current subject (before the change).
transformation
- Provides the subject.
Return
The newly created Expect for the extracted feature.