interface AssertionContainer<T> : SubjectProvider<T>
Represents the extension point of the logic level for subjects of type T.
In contrast to assertion function defined for Expect which usually return Expect, functions defined for AssertionContainer return Assertion so that they can be appended to whatever we want.
Note, do not use SubjectProvider as this interface is only temporary and will most likely be removed without further notice.
T
- The type of the subject of the assertion.
abstract val maybeSubject: Option<T>
Either Some wrapping the subject of an Assertion or None in case a previous subject change could not be carried out. |
abstract val
The subject of an Assertion -- deprecated, will be removed with 1.0.0. |
abstract fun <I : Any> getImpl(kClass: KClass<I>, defaultFactory: () -> I): I
Do not use yet, this is experimental |
val <T> AssertionContainer<T>.changeSubject: SubjectChangerBuilder.KindStep<T>
Entry point to use the SubjectChangerBuilder based on this AssertionContainer. |
|
val <T> AssertionContainer<T>.extractFeature: FeatureExtractorBuilder.DescriptionStep<T>
Entry point to use the FeatureExtractorBuilder based on this AssertionContainer. |
|
val <T> AssertionContainer<T>.featureExtractor: FeatureExtractor |
|
val <T> AssertionContainer<T>.subjectChanger: SubjectChanger |
fun <T> AssertionContainer<T>.collect(assertionCreator: Expect<T>.() -> Unit): Assertion
Use this function if you want to make Assertions about a feature or you perform a type transformation or any other action which results in an assertion container being created and you do not require this resulting container. |
|
fun <T> AssertionContainer<T>.createDescriptiveAssertion(description: Translatable, representation: Any?, test: (T) -> Boolean): Assertion
Creates a DescriptiveAssertion based on the given description, representation and test. |
|
fun <T, R> AssertionContainer<T>.genericSubjectBasedFeature(provider: (T) -> MetaFeature<R>): FeatureExtractorBuilder.ExecutionStep<T, R> |
|
fun <T> AssertionContainer<*>.iterableLikeToIterable(iterableLike: IterableLike): Iterable<T>
Transforms the given IterableLike to an Iterable with an element type T. |
|
fun <T, R> AssertionContainer<T>.manualFeature(description: String, provider: T.() -> R): FeatureExtractorBuilder.ExecutionStep<T, R>
Convenience method to pass a String as description which is wrapped into an Untranslatable instead of passing a Translatable. |
|
fun <T> AssertionContainer<T>.toExpect(): Expect<T>
Casts this AssertionContainer back to an Expect so that you can use it in places where an Expect is used. |
|
fun <T> AssertionContainer<*>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>
Transforms the given IterableLike to |
interface ExpectInternal<T> : Expect<T>, AssertionContainer<T>
Sole purpose of this interface is to hide AssertionContainer from newcomers which usually don't have to deal with this. |