Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { PkgName string SrcPkgQualifier string Imports []*registry.Package Mocks []MockData StubImpl bool SkipEnsure bool WithResets bool }
Data is the template data used to render the Moq template.
func (Data) MocksHaveMethod ¶
MocksHaveMethod returns true of any one of the Mocks has at least 1 method.
type MethodData ¶
MethodData is the data which represents a method on some interface.
func (MethodData) ArgCallList ¶
func (m MethodData) ArgCallList() string
ArgCallList is the string representation of method call parameters, ex: 's, n, foo'. In case of a last variadic parameter, it will be of the format 's, n, foos...'.
func (MethodData) ArgList ¶
func (m MethodData) ArgList() string
ArgList is the string representation of method parameters, ex: 's string, n int, foo bar.Baz'.
func (MethodData) ReturnArgNameList ¶
func (m MethodData) ReturnArgNameList() string
ReturnArgNameList is the string representation of values being returned from the method, ex: 'foo', 's, err'.
func (MethodData) ReturnArgTypeList ¶
func (m MethodData) ReturnArgTypeList() string
ReturnArgTypeList is the string representation of method return types, ex: 'bar.Baz', '(string, error)'.
type MockData ¶
type MockData struct { InterfaceName string MockName string TypeParams []TypeParamData Methods []MethodData }
MockData is the data used to generate a mock for some interface.
type ParamData ¶
ParamData is the data which represents a parameter to some method of an interface.
func (ParamData) CallName ¶
CallName returns the string representation of the parameter to be used for a method call. For a variadic paramter, it will be of the format 'foos...'.
func (ParamData) MethodArg ¶
MethodArg is the representation of the parameter in the function signature, ex: 'name a.Type'.
func (ParamData) TypeString ¶
TypeString returns the string representation of the type of the parameter.
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is the Moq template. It is capable of generating the Moq implementation for the given template.Data.