Composite

Arg matcher that must be composed with other matchers. Every composite matcher has to implement Capture to propagate it to its children. Use dev.mokkery.matcher.capture.propagateCapture for convenience.

Check existing implementations to learn how to implement it correctly

Inheritors

Functions

Link copied to clipboard
abstract fun assertFilled()

Checks if is it is properly filled and throws exception if it is not. It is called when composite is considered "final". It is often used to verify missing matchers.

Link copied to clipboard
abstract override fun capture(value: T)

Propagates value to children matchers.

Link copied to clipboard
abstract fun compose(matcher: ArgMatcher<T>): ArgMatcher.Composite<T>

Returns new Composite with matcher merged. This method gets matchers in reversed order.

Link copied to clipboard
abstract fun isFilled(): Boolean

Returns true if it is merged with all required matchers and must not be merged anymore.

Link copied to clipboard
abstract fun matches(arg: T): Boolean
Link copied to clipboard

Helper function to propagate capture for dev.mokkery.matcher.ArgMatcher.Composite.