FeatureExtractor
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, assuming that the call as such always succeeds (no exception is thrown). 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.
Inheritors
Functions
Link copied to clipboard
abstract fun <SubjectT, FeatureT> extract(container: AssertionContainer<SubjectT>, description: Translatable, representationForFailure: Any, featureExtraction: (SubjectT) -> Option<FeatureT>, maybeSubAssertions: Option<Expect<FeatureT>.() -> Unit>, featureExpectOptions: FeatureExpectOptions<FeatureT>): FeatureExpect<SubjectT, FeatureT>
Extracts a feature according to the given featureExtraction, creates an Expect for the new subject and applies maybeSubAssertions in case they are specified.