doc / ch.tutteli.atrium.domain.builders / AssertImplCommon / changeToNullableSubject

changeToNullableSubject

open fun <T, R> changeToNullableSubject(originalPlant: BaseAssertionPlant<T, *>, subjectProvider: () -> R): AssertionPlantNullable<R>
Deprecated: Use ExpectImpl.changeSubject.unreported; will be removed with 1.0.0 - moreover we advice you to switch to Expect and no longer use Assert

Creates a new AssertionPlantNullable based on the given subjectProvider whereas the AssertionPlant delegates assertion checking to the given originalPlant.

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, if you do not require the resulting AssertionPlantNullable but merely want to make feature assertions so that you can use them as part of a bigger assertion, then use collector instead.

open fun <T, R : Any> changeToNullableSubject(originalAssertionCreator: Expect<T>, transformation: (T) -> R): Expect<R>
Deprecated: Use ExpectImpl.changeSubject.unreported - this method was introduced in 0.9.0 to ease the migration from Assert to Expect; will be removed with 1.0.0