ExpectInternal

The internal type which we work with which combines Expect, AssertionContainer and ExpectGrouping.

In theory, Expect should extend ExpectGrouping but due to Kotlin type inference/overload resolution bugs, we have to split it. One benefit of it, we can define extensions for ExpectGrouping which are not visible for Expect.

Similarly, we separate Expect from AssertionContainer so that we can provide extension functions for AssertionContainer which are more or less identical to the ones defined for api-fluent but don't return an Expect but Assertion etc.

Also, we separate Expect form AssertionContainer since a lot of functionality defined for AssertionContainer is not relevant for newcomers to Atrium (see https://github.com/robstoll/atrium-roadmap/wiki/Requirements#personas for more information about the personas).

Inheritors

Properties

Link copied to clipboard

Do not use yet, this is experimental

Link copied to clipboard
abstract val maybeSubject: Option<T>

Either Some wrapping the subject of an Assertion or None in case a previous subject transformation could not be carried out.

Functions

Link copied to clipboard
abstract fun append(assertion: Assertion): Expect<T>

Appends the given assertion to this container and returns an Expect which includes it.

Link copied to clipboard
abstract fun appendAsGroup(assertionCreator: Expect<T>.() -> Unit): Expect<T>

Appends the Assertions the given assertionCreator creates to this container and returns an Expect which includes them.

Link copied to clipboard
open fun createAndAppend(description: Translatable, expected: Any?, test: (T) -> Boolean): Expect<T>
open fun createAndAppend(description: String, expected: Any?, test: (T) -> Boolean): Expect<T>

Creates a DescriptiveAssertion based on the given description, expected and test and appends it to the container.

Link copied to clipboard
abstract fun <I : Any> getImpl(kClass: KClass<I>, defaultFactory: () -> I): I

Do not use yet, this is experimental and might change or be removed without prior notice.