doc / ch.tutteli.atrium.logic

Package ch.tutteli.atrium.logic

Contains all the assertion interfaces (e.g. AnyAssertions as well as _logic and helper functions for AssertionContainer

Types

AnyAssertions

interface AnyAssertions

Collection of assertion functions and builders which are applicable to any type (sometimes Any? sometimes Any).

BigDecimalAssertions

interface BigDecimalAssertions

Collection of assertion functions and builders which are applicable to subjects with a BigDecimal type.

CharSequenceAssertions

interface CharSequenceAssertions

Collection of assertion functions and builders which are applicable to subjects with a CharSequence type.

ChronoLocalDateAssertions

interface ChronoLocalDateAssertions

Collection of assertion functions and builders which are applicable to subjects with a ChronoLocalDate type.

ChronoLocalDateTimeAssertions

interface ChronoLocalDateTimeAssertions

Collection of assertion functions and builders which are applicable to subjects with a ChronoLocalDateTime type.

ChronoZonedDateTimeAssertions

interface ChronoZonedDateTimeAssertions

Collection of assertion functions and builders which are applicable to subjects with a ChronoZonedDateTime type.

CollectionLikeAssertions

interface CollectionLikeAssertions

Collection of assertion functions and builders which are applicable to subjects which can be transformed to a Collection - intended for types which are Collection like such as Map.

ComparableAssertions

interface ComparableAssertions

Collection of assertion functions and builders which are applicable to subjects with a Comparable type.

FeatureAssertions

interface FeatureAssertions

Collection of functions which help to create feature assertions by returning FeatureExtractorBuilder.ExecutionStep.

FloatingPointAssertions

interface FloatingPointAssertions

Collection of assertion functions and builders which are applicable to subjects with a floating point number like type (currently Float and Double).

FloatingPointJvmAssertions

interface FloatingPointJvmAssertions

Collection of assertion functions and builders which are applicable to floating point number like types which are specific to the JVM platform (currently only for BigDecimal).

Fun0Assertions

interface Fun0Assertions

Collection of assertion functions and builders which are applicable to subjects with a kotlin.Function0 type.

IterableLikeAssertions

interface IterableLikeAssertions

Collection of assertion functions and builders which are applicable to subjects which can be transformed to an Iterable - intended for types which are Iterable like such as Array or Sequence.

IteratorAssertions

interface IteratorAssertions

Collection of assertion functions and builders which are applicable to subjects with an Iterator type.

ListAssertions

interface ListAssertions

Collection of assertion functions and builders which are applicable to subjects with a List type.

LocalDateAssertions

interface LocalDateAssertions

Collection of assertion functions and builders which are applicable to subjects with a LocalDate type.

LocalDateTimeAssertions

interface LocalDateTimeAssertions

Collection of assertion functions and builders which are applicable to subjects with a LocalDateTime type.

MapEntryAssertions

interface MapEntryAssertions

Collection of assertion functions and builders which are applicable to subjects with a Map.Entry type.

MapLikeAssertions

interface MapLikeAssertions

Collection of assertion functions and builders which are applicable to subjects which can be transformed to a Map - intended for types which are Map like such as IterableLike with an element type Pair.

OptionalAssertions

interface OptionalAssertions

Collection of assertion functions and builders which are applicable to subjects with an Optional type.

PairAssertions

interface PairAssertions

Collection of assertion functions and builders which are applicable to subjects with a Pair type.

PathAssertions

interface PathAssertions

Collection of assertion functions and builders which are applicable to subjects with a Path type.

ThrowableAssertions

interface ThrowableAssertions

Collection of assertion functions and builders which are applicable to subjects with a Throwable type.

ZonedDateTimeAssertions

interface ZonedDateTimeAssertions

Collection of assertion functions and builders which are applicable to subjects with a ZonedDateTime type.

Properties

_logic

val <T> Expect<T>._logic: AssertionContainer<T>

Entry point to the logic level of Atrium -- which is one level deeper than the API -- on which assertion functions do not return Expects but Assertions and the like.

val <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.EntryPointStep<T, S>._logic: CharSequenceContains.EntryPointStepLogic<T, S>
val <T : CharSequence, S : CharSequenceContains.SearchBehaviour> WithTimesCheckerStep<T, S>._logic: WithTimesCheckerStepLogic<T, S>
val <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.CheckerStep<T, S>._logic: CharSequenceContains.CheckerStepLogic<T, S>

Entry point to the logic level of Atrium -- which is one level deeper than the API -- within the building process of a sophisticated contains assertion for CharSequence.

val <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStep<E, T, S>._logic: IterableLikeContains.EntryPointStepLogic<E, T, S>
val <E, T : Any, S : IterableLikeContains.SearchBehaviour> WithTimesCheckerStep<E, T, S>._logic: WithTimesCheckerStepLogic<E, T, S>
val <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.CheckerStep<E, T, S>._logic: IterableLikeContains.CheckerStepLogic<E, T, S>
val <K, V, T : Any, S : MapLikeContains.SearchBehaviour> MapLikeContains.EntryPointStep<K, V, T, S>._logic: MapLikeContains.EntryPointStepLogic<K, V, T, S>

Entry point to the logic level of Atrium -- which is one level deeper than the API -- within the building process of a sophisticated contains assertion for Iterable.

changeSubject

val <T> AssertionContainer<T>.changeSubject: SubjectChangerBuilder.KindStep<T>

Entry point to use the SubjectChangerBuilder based on this AssertionContainer.

extractFeature

val <T> AssertionContainer<T>.extractFeature: FeatureExtractorBuilder.DescriptionStep<T>

Entry point to use the FeatureExtractorBuilder based on this AssertionContainer.

Functions

_logicAppend

fun <T> Expect<T>._logicAppend(factory: AssertionContainer<T>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this Expect.

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.CheckerStep<T, S>._logicAppend(factory: CharSequenceContains.CheckerStepLogic<T, S>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this CharSequenceContains.CheckerStep.

fun <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStep<E, T, S>._logicAppend(factory: IterableLikeContains.EntryPointStepLogic<E, T, S>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this IterableLikeContains.EntryPointStep.

fun <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.CheckerStep<E, T, S>._logicAppend(factory: IterableLikeContains.CheckerStepLogic<E, T, S>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this IterableLikeContains.CheckerStep.

fun <K, V, T : Any, S : MapLikeContains.SearchBehaviour> MapLikeContains.EntryPointStep<K, V, T, S>._logicAppend(factory: MapLikeContains.EntryPointStepLogic<K, V, T, S>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this MapLikeContains.EntryPointStep.

collect

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.

collectAndLogicAppend

fun <T, R> TransformationExecutionStep<T, R, *>.collectAndLogicAppend(assertionCreator: AssertionContainer<R>.() -> Assertion): Expect<T>

Finishes the transformation process by appending the Assertion which is returned when calling TransformationExecutionStep.collectAndAppend with _logicAppend and the given assertionCreator.

collectForComposition

fun <T> collectForComposition(maybeSubject: Option<T>, assertionCreator: Expect<T>.() -> Unit): List<Assertion>

Use this function if you want to collect Assertions and use it as part of an AssertionGroup.

createDescriptiveAssertion

fun <T> AssertionContainer<T>.createDescriptiveAssertion(description: Translatable, representation: Any?, test: (T) -> Boolean): Assertion

Creates a DescriptiveAssertion based on the given description, representation and test.

genericSubjectBasedFeature

fun <T, R> AssertionContainer<T>.genericSubjectBasedFeature(provider: (T) -> MetaFeature<R>): FeatureExtractorBuilder.ExecutionStep<T, R>

manualFeature

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.

toAssertionContainer

fun <T> Expect<T>.toAssertionContainer(): AssertionContainer<T>

Casts this Expect to an AssertionContainer so that you have access to the functionality provided on the logic level.

toExpect

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.