doc / ch.tutteli.atrium / IAtriumFactory

IAtriumFactory

interface IAtriumFactory (source)

The minimum contract of the abstract factory of atrium.

It provides factory methods to create:

Functions

newCheckImmediately abstract fun <T : Any> newCheckImmediately(assertionVerb: String, subject: T, reporter: IReporter): IAssertionPlant<T>
abstract fun <T : Any> newCheckImmediately(assertionVerb: String, subject: T, assertionChecker: IAssertionChecker): IAssertionPlant<T>
abstract fun <T : Any> newCheckImmediately(commonFields: CommonFields<T>): IAssertionPlant<T>

Creates an IAssertionPlant which immediately checks added IAssertions.

newCheckLazily abstract fun <T : Any> newCheckLazily(assertionVerb: String, subject: T, reporter: IReporter): IAssertionPlant<T>
abstract fun <T : Any> newCheckLazily(assertionVerb: String, subject: T, assertionChecker: IAssertionChecker): IAssertionPlant<T>
abstract fun <T : Any> newCheckLazily(commonFields: CommonFields<T>): IAssertionPlant<T>

Creates an IAssertionPlant which does not check the created or added IAssertions until one calls IAssertionPlant.checkAssertions.

newDetailedObjectFormatter abstract fun newDetailedObjectFormatter(): IObjectFormatter

Creates an IObjectFormatter which represents objects by using their Object.toString representation including Class.name and their System.identityHashCode.

newFeatureAssertionChecker abstract fun <T : Any> newFeatureAssertionChecker(subjectPlant: IAssertionPlant<T>): IAssertionChecker

Creates an IAssertionChecker which creates IFeatureAssertionGroup instead of checking assertions and delegates this task to the given subjectPlant by adding (see IAssertionPlant.addAssertion the created IFeatureAssertionGroup to it.

newNullable abstract fun <T> newNullable(assertionVerb: String, subject: T, reporter: IReporter): IAssertionPlantNullable<T>
abstract fun <T> newNullable(assertionVerb: String, subject: T, assertionChecker: IAssertionChecker): IAssertionPlantNullable<T>
abstract fun <T> newNullable(commonFields: CommonFields<T>): IAssertionPlantNullable<T>

Creates an IAssertionPlantNullable.

newOnlyFailureReporter abstract fun newOnlyFailureReporter(assertionFormatter: IAssertionFormatter): IReporter

Creates an IReporter which reports only failing assertions and uses the given assertionFormatter to format assertions and messages.

newSameLineAssertionFormatter abstract fun newSameLineAssertionFormatter(objectFormatter: IObjectFormatter): IAssertionFormatter

Creates an IAssertionFormatter which puts messages of the form 'a: b' on the same line.

newThrowingAssertionChecker abstract fun newThrowingAssertionChecker(reporter: IReporter): IAssertionChecker

Creates an IAssertionChecker which throws AssertionErrors in case an assertion fails and uses the given reporter for reporting.

Inheritors

AtriumFactory object AtriumFactory : IAtriumFactory

The abstract factory of atrium.