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

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.

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

throwStruct
auto throwStruct()

A mock struct that always throws.

Mixin templates

MockImplCommon
mixintemplate MockImplCommon()
Undocumented in source.

Structs

Mock
struct Mock(T)

A mock object that conforms to an interface/class.

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

Meta