doc / ch.tutteli.atrium.domain.creating.feature.extract / FeatureExtractor

FeatureExtractor

interface FeatureExtractor (source)

Defines the contract for sophisticated safe feature extractions including assertion creation for the feature.

It is similar to FeatureAssertions but differs in the intended usage. FeatureAssertions are intended to make assertions about a return value of a method call or a property, regardless if this call/access fails or not. The FeatureExtractor on the other hand should be used if it is already known, that the call/access fails depending on given arguments. For instance, List.get is a good example where it fails if the given index is out of bounds.

Types

Creator

interface Creator<TSubject, T : Any> : CreatorLike<TSubject, T, AssertionPlant<T>, CollectingAssertionPlant<T>>

Final step of the sophisticated safe feature extraction where one can define extractAndAssertIt for the extracted feature or use extract to get a feature AssertionPlant.

CreatorLike

interface CreatorLike<TSubject, T, A : BaseAssertionPlant<T, A>, C : BaseCollectingAssertionPlant<T, A, C>>

Final step of the sophisticated safe feature extraction where one can define extractAndAssertIt for the extracted feature or use extract to get the assertion plant.

CreatorNullable

interface CreatorNullable<TSubject, T> : CreatorLike<TSubject, T, AssertionPlantNullable<T>, CollectingAssertionPlantNullable<T>>

Final step of the sophisticated safe feature extraction where one can define extractAndAssertIt for the extracted feature or use extract to get a feature AssertionPlantNullable.

ParameterObject

data class ParameterObject<TSubject, T>

A parameter object which contains all necessary information to extract a feature -- however, not to create assertions.

ParameterObjectOption

interface ParameterObjectOption

Step to define the ParameterObject.

RepresentationOption

interface RepresentationOption

Provides options to chose the representation of the feature.

Companion Object Properties

builder

val builder: RepresentationOption

Entry point to use the feature extractor.