Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerMock ¶
type HandlerMock struct { // HandleFunc mocks the Handle method. HandleFunc func(ctx context.Context, filterID string, err error) // contains filtered or unexported fields }
HandlerMock is a mock implementation of errors.Handler.
func TestSomethingThatUsesHandler(t *testing.T) { // make and configure a mocked errors.Handler mockedHandler := &HandlerMock{ HandleFunc: func(ctx context.Context, filterID string, err error) { panic("mock out the Handle method") }, } // use mockedHandler in code that requires errors.Handler // and then make assertions. }
func (*HandlerMock) Handle ¶
func (mock *HandlerMock) Handle(ctx context.Context, filterID string, err error)
Handle calls HandleFunc.
func (*HandlerMock) HandleCalls ¶
func (mock *HandlerMock) HandleCalls() []struct { Ctx context.Context FilterID string Err error }
HandleCalls gets all the calls that were made to Handle. Check the length with:
len(mockedHandler.HandleCalls())
Click to show internal directories.
Click to hide internal directories.