Documentation ¶
Index ¶
- type Client
- func (m *Client) Call(methodName string, args ...interface{}) (v xmlrpc.Value, err error)
- func (m *Client) ExpectArgument(index int, kind reflect.Kind, expected interface{})
- func (m *Client) ExpectArgumentCount(expected int)
- func (m *Client) ExpectMethodName(expected string)
- func (m *Client) WithError(err error) *Client
- func (m *Client) WithValue(v xmlrpc.Value) *Client
- type Member
- type Value
- func (m *Value) Bool() bool
- func (m *Value) Bytes() []byte
- func (m *Value) Double() float64
- func (m *Value) Int() int
- func (m *Value) Kind() xmlrpc.Kind
- func (m *Value) Members() []xmlrpc.Member
- func (m *Value) String() string
- func (m *Value) Time() time.Time
- func (m *Value) Values() []xmlrpc.Value
- func (m *Value) WithBool(v bool) *Value
- func (m *Value) WithBytes(v []byte) *Value
- func (m *Value) WithDouble(v float64) *Value
- func (m *Value) WithInt(v int) *Value
- func (m *Value) WithMembers(v map[string]xmlrpc.Value) *Value
- func (m *Value) WithString(v string) *Value
- func (m *Value) WithTime(v time.Time) *Value
- func (m *Value) WithValues(v ...xmlrpc.Value) *Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // CallMock will be invoked every time Call() is called. CallMock func(methodName string, args ...interface{}) (xmlrpc.Value, error) // Testing, if non-nill, will be used to assert that expectations about // the call hold true. Testing *testing.T // contains filtered or unexported fields }
Client is a mock object for xmlrpc.Client. It can be used to fake XML-RPC calls in tests. If the client contains a non-nil instance of *testing.T, it will assert that any expectations about the call, that were made, hold true.
func NewClient ¶
NewClient returns a new mock object for xmlrpc.Client. If t is non-nil, it will be used to assert that expectations about the call hold true. To get any use out of the mock Client, you must set CallMock directly or call either of WithValue() or WithError().
func (*Client) Call ¶
Call invokes CallMock and returns its result. If the Testing is non-nil, it will also assert that any expectations about the call hold true.
func (*Client) ExpectArgument ¶
ExpectArgument will assert that Call() is called with an arg of a specific kind and an expected value at a specific index in the args slice when Call() is called and Testing is non-nil.
func (*Client) ExpectArgumentCount ¶
ExpectArgumentCount will assert that Call() is called with the expected number of args when Call() is called and Testing is non-nil.
func (*Client) ExpectMethodName ¶
ExpectMethodName will assert that Call() is called with the expected methodName when Call() is called and Testing is non-nil.
type Member ¶
type Member struct { // NameMock will be invoked every time Name() is called. NameMock func() string // ValueMock will be invoked every time Value() is called. ValueMock func() xmlrpc.Value }
Member is a mock object for xmlrpc.Member.
func NewMember ¶
func NewMember() *Member
NewMember returns a new mock object for xmlrpc.Member, which will act as if it did have an empty name and contained an invalid xmlrpc.Value.
func (*Member) Value ¶
func (m *Member) Value() xmlrpc.Value
Value invokes ValueMock and returns its result.
type Value ¶
type Value struct { // ValuesMock will be invoked every time Values() is called. ValuesMock func() []xmlrpc.Value // BytesMock will be invoked every time Bytes() is called. BytesMock func() []byte // BoolMock will be invoked every time Bool() is called. BoolMock func() bool // TimeMock will be invoked every time Time() is called. TimeMock func() time.Time // DoubleMock will be invoked every time Double() is called. DoubleMock func() float64 // IntMock will be invoked every time Int() is called. IntMock func() int // StringMock will be invoked every time String() is called. StringMock func() string // MembersMock will be invoked every time Members() is called. MembersMock func() []xmlrpc.Member // KindMock will be invoked every time Kind() is called. KindMock func() xmlrpc.Kind }
Value is a mock object for xmlrpc.Value.
func NewValue ¶
func NewValue() *Value
NewValue returns a new mock object for xmlrpc.Value, which will act as if it were of an invalid kind.
func (*Value) Kind ¶
func (m *Value) Kind() xmlrpc.Kind
Kind invokes KindMock and returns its result.
func (*Value) Members ¶
func (m *Value) Members() []xmlrpc.Member
Members invokes MembersMock and returns its result.
func (*Value) Values ¶
func (m *Value) Values() []xmlrpc.Value
Values invokes ValuesMock and returns its result.
func (*Value) WithBool ¶
WithBool assigns funcs to KindMock and BoolMock. The func in KindMock will return xmlrpc.Bool, whereas the func in BoolMock will return v.
func (*Value) WithBytes ¶
WithBytes assigns funcs to KindMock and BytesMock. The func in KindMock will return xmlrpc.Base64, whereas the func in BytesMock will return v.
func (*Value) WithDouble ¶
WithDouble assigns funcs to KindMock and DoubleMock. The func in KindMock will return xmlrpc.Double, whereas the func in DoubleMock will return v.
func (*Value) WithInt ¶
WithInt assigns funcs to KindMock and IntMock. The func in KindMock will return xmlrpc.Int, whereas the func in IntMock will return v.
func (*Value) WithMembers ¶
WithMembers assigns funcs to KindMock and MembersMock. The func in KindMock will return xmlrpc.Struct, whereas the func in MembersMock will return v.
func (*Value) WithString ¶
WithString assigns funcs to KindMock and StringMock. The func in KindMock will return xmlrpc.String, whereas the func in StringMock will return v.
func (*Value) WithTime ¶
WithTime assigns funcs to KindMock and TimeMock. The func in KindMock will return xmlrpc.DateTime, whereas the func in TimeMock will return v.
func (*Value) WithValues ¶
WithValues assigns funcs to KindMock and ValuesMock. The func in KindMock will return xmlrpc.Array, whereas the func in ValuesMock will return v.