expect

fun <T> expect(subject: T): RootExpect<T>(source)

Creates an Expect for the given subject.

Return

The newly created Expect.

Parameters

subject

The subject for which we are going to postulate expectations.

Throws

in case an assertion does not hold.


fun <T> expect(subject: T, assertionCreator: Expect<T>.() -> Unit): Expect<T>(source)

Creates an Expect for the given subject and appends the expectations the given assertionCreator-lambda creates as group to it.

Return

The newly created Expect.

Parameters

subject

The subject for which we are going to postulate expectations.

assertionCreator

expectation-group with a non-fail fast behaviour.

Throws

in case an assertion does not hold.


fun <T, R> Expect<T>.expect(newSubject: R): FeatureExpect<T, R>(source)

Creates an Expect for the given (unrelated) newSubject.

We recommend to use its or feature or another feature extractor if you want to extract a feature out of the current subject.

Return

The newly created Expect.

Since

1.0.0

Parameters

newSubject

The subject for which we are going to postulate expectations.

Throws

in case an assertion does not hold.


fun <T, R> Expect<T>.expect(newSubject: R, assertionCreator: Expect<R>.() -> Unit): Expect<R>(source)

Creates an Expect for the given (unrelated) newSubject and appends the expectations the given assertionCreator-lambda creates as group to it.

Consider to use expectGrouped instead of expect as expectation entry point if you want to state expectations about several unrelated subjects. expectGrouped fulfills exactly this purpose.

We recommend to use its or feature or another feature extractor if you want to extract a feature out of the current subject.

Return

The newly created Expect.

Since

1.0.0

Parameters

newSubject

The new subject for which we are going to postulate expectations.

assertionCreator

expectation-group with a non-fail fast behaviour.


fun <R> ExpectGrouping.expect(subject: R): Expect<R>(source)

Creates an Expect for the given subject.

Return

The newly created Expect.

Since

1.1.0

Parameters

subject

The new subject for which we are going to postulate expectations.


fun <R> ExpectGrouping.expect(subject: R, assertionCreator: Expect<R>.() -> Unit): Expect<R>(source)

Creates an Expect for the given subject and appends the expectations the given assertionCreator-lambda creates as group to it.

Return

The newly created Expect.

Since

1.1.0

Parameters

subject

The new subject for which we are going to postulate expectations.

assertionCreator

has to create at least one expectation where all are wrapped into an expectation-group with a non-fail fast behaviour.