Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarshallerMock ¶
type MarshallerMock struct { // MarshalFunc mocks the Marshal method. MarshalFunc func(s interface{}) ([]byte, error) // contains filtered or unexported fields }
MarshallerMock is a mock implementation of event.Marshaller.
func TestSomethingThatUsesMarshaller(t *testing.T) { // make and configure a mocked event.Marshaller mockedMarshaller := &MarshallerMock{ MarshalFunc: func(s interface{}) ([]byte, error) { panic("mock out the Marshal method") }, } // use mockedMarshaller in code that requires event.Marshaller // and then make assertions. }
func (*MarshallerMock) Marshal ¶
func (mock *MarshallerMock) Marshal(s interface{}) ([]byte, error)
Marshal calls MarshalFunc.
func (*MarshallerMock) MarshalCalls ¶
func (mock *MarshallerMock) MarshalCalls() []struct { S interface{} }
MarshalCalls gets all the calls that were made to Marshal. Check the length with:
len(mockedMarshaller.MarshalCalls())
Click to show internal directories.
Click to hide internal directories.