CaptureMatcher

class CaptureMatcher<T>(capture: Capture<T>, matcher: ArgMatcher<T>? = null) : ArgMatcher.Composite<T>

Matches an argument with matcher and captures arguments into capture.

See also

Constructors

Link copied to clipboard
constructor(capture: Capture<T>, matcher: ArgMatcher<T>? = null)

Functions

Link copied to clipboard
open override 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
open override fun capture(value: T)

Propagates value to children matchers.

Link copied to clipboard
open override 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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isFilled(): Boolean

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

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

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

Link copied to clipboard
open override fun toString(): String