MethodMock

A BaseMethodMock for non-suspending methods.

Constructors

Link copied to clipboard
constructor(parametersSpec: W)

Types

Link copied to clipboard

A BaseMethodMock.Stub for non-suspending methods.

Functions

Link copied to clipboard

Calls a MethodMock without any parameters

Calls a MethodMock with one parameter

Calls a MethodMock with two parameters

Calls a MethodMock with three parameters

Calls a MethodMock with four parameters

Calls a MethodMock with five parameters

Link copied to clipboard

Generates a stub for a BaseMethodMock without and parameters

Generates a stub for a BaseMethodMock with one parameter

Generates a stub for a BaseMethodMock with two parameters

Generates a stub for a BaseMethodMock with three parameters

Generates a stub for a BaseMethodMock with four parameters

fun <T0, T1, T2, T3, T4, Result, Answer : BaseAnswer<QuintupleParameters.Values<T0, T1, T2, T3, T4>, Result>, Stub : BaseMethodMock.Stub<QuintupleParameters.Matchers<T0, T1, T2, T3, T4>, QuintupleParameters.Values<T0, T1, T2, T3, T4>, Result, Answer>> BaseMethodMock<QuintupleParameters.Matchers<T0, T1, T2, T3, T4>, QuintupleParameters.MatchersOrCaptor<T0, T1, T2, T3, T4>, QuintupleParameters.Values<T0, T1, T2, T3, T4>, QuintupleParameters<T0, T1, T2, T3, T4>, Result, Answer, Stub>.on(first: ParameterMatcher<T0> = ParameterMatcher.any(), second: ParameterMatcher<T1> = ParameterMatcher.any(), third: ParameterMatcher<T2> = ParameterMatcher.any(), fourth: ParameterMatcher<T3> = ParameterMatcher.any(), fifth: ParameterMatcher<T4> = ParameterMatcher.any()): Stub

Generates a stub for a BaseMethodMock with five parameters

Link copied to clipboard
fun reset()

Resets both calls and stubbs. Shorthand for resetCalls and resetStubs

Link copied to clipboard

Resets all calls to this mock method. This means that verify(times=0) should succeed

Link copied to clipboard

Removes all stubbs from this mock method. Note that this also removes any default stubbs that may have been created when declaring the mock.

Link copied to clipboard

Verifies that a BaseMethodMock without parameters has been called

Verifies that a BaseMethodMock with one parameters has been called with a ParameterMatcherOrCaptor

Verifies that a BaseMethodMock with two parameters has been called with all parameters matching their respective ParameterMatcherOrCaptor

Verifies that a BaseMethodMock with three parameters has been called with all parameters matching their respective ParameterMatcherOrCaptor

Verifies that a BaseMethodMock with four parameters has been called with all parameters matching their respective ParameterMatcherOrCaptor

Verifies that a BaseMethodMock with five parameters has been called with all parameters matching their respective ParameterMatcherOrCaptor