unit_threaded.mock

Support the automatic implementation of test doubles via programmable mocks.

Members

Aliases

Identity
alias Identity(alias T) = T
Undocumented in source.

Enums

isMockReturn
eponymoustemplate isMockReturn(T)
Undocumented in source.
isReturnValue
eponymoustemplate isReturnValue(alias T)
Undocumented in source.
isValue
eponymoustemplate isValue(alias T)
Undocumented in source.

Functions

implMixinStr
string implMixinStr()
Undocumented in source. Be warned that the author may not have intended to support it.
mock
auto mock()

Helper function for creating a Mock object.

mockReturn
auto mockReturn(V values)
Undocumented in source. Be warned that the author may not have intended to support it.
mockStruct
auto mockStruct(T returns)

Version of mockStruct that accepts 0 or more values of the same type. Whatever function is called on it, these values will be returned one by one. The limitation is that if more than one function is called on the mock, they all return the same type

mockStruct
auto mockStruct()

Version of mockStruct that accepts a compile-time mapping of function name to return values. Each template parameter must be a value of type ReturnValues

mockStruct
auto mockStruct(R returns)
Undocumented in source. Be warned that the author may not have intended to support it.
throwStruct
auto throwStruct()

A mock struct that always throws.

Structs

Mock
struct Mock(T)

A mock object that conforms to an interface/class.

ReturnValues
struct ReturnValues(string function_, T...)
Undocumented in source.

Templates

allSameType
template allSameType(V...)
Undocumented in source.

Meta