Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClientMock ¶
type HTTPClientMock struct {
// DoFunc mocks the Do method.
DoFunc func(ctx context.Context, method string, endpoint string, expStatus int, req interface{}, out interface{}) error
// contains filtered or unexported fields
}
HTTPClientMock is a mock implementation of data.HTTPClient.
func TestSomethingThatUsesHTTPClient(t *testing.T) {
// make and configure a mocked data.HTTPClient
mockedHTTPClient := &HTTPClientMock{
DoFunc: func(ctx context.Context, method string, endpoint string, expStatus int, req interface{}, out interface{}) error {
panic("mock out the Do method")
},
}
// use mockedHTTPClient in code that requires data.HTTPClient
// and then make assertions.
}
Click to show internal directories.
Click to hide internal directories.