Call

$(D_PSYMBOL Call) represents a single call of a mocked method.

Members

Aliases

Arguments
alias Arguments = Maybe!ParameterTypes

Expected arguments if any.

ParameterTypes
alias ParameterTypes = .Parameters!F
Undocumented in source.
Parameters
alias Parameters = PT

Arguments passed to set the expectation up.

Return
alias Return = ReturnType!F

Return type of the mocked method.

qualifiers
alias qualifiers = AliasSeq!(__traits(getFunctionAttributes, F))

Attribute set of the mocked method.

Functions

action
typeof(this) action(Action callback)

When the method which matches this expectation is called execute the given delegate. The delegate's signature must match the signature of the called method.

compareArguments
bool compareArguments(ParameterTypes arguments)
Undocumented in source. Be warned that the author may not have intended to support it.
customArgsComparator
deprecated typeof(this) customArgsComparator(CustomArgsComparator comparator)

Allow providing custom argument comparator for matching calls to this expectation.

ignoreArgs
deprecated typeof(this) ignoreArgs()
Undocumented in source. Be warned that the author may not have intended to support it.
passThrough
typeof(this) passThrough()

Instead of returning or throwing a given value, pass the call through to the mocked type object.

repeat
typeof(this) repeat(uint times)

This expectation will match exactly times times.

repeatAny
typeof(this) repeatAny()

This expectation will match to any number of calls.

returns
typeof(this) returns(Return value)

Set the value to return when method matching this expectation is called on a mock object.

throws
typeof(this) throws(Exception exception)

When the method which matches this expectation is called, throw the given exception. If there are any actions specified (via the action method), they will not be executed.

Variables

action_
Action action_;
Undocumented in source.
arguments
Arguments arguments;

Expected arguments if any.

customArgsComparator_
CustomArgsComparator customArgsComparator_;
Undocumented in source.
exception
Exception exception;
Undocumented in source.
ignoreArgs_
bool ignoreArgs_;
Undocumented in source.
passThrough_
bool passThrough_;
Undocumented in source.
repeat_
uint repeat_;
Undocumented in source.
return_
Return return_;
Undocumented in source.

Parameters

F

Function represented by this $(D_PSYMBOL Call).

Meta