Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIMock ¶
type APIMock struct { // VideoTitleFunc mocks the VideoTitle method. VideoTitleFunc func(ctx context.Context, u *url.URL) string // contains filtered or unexported fields }
APIMock is a mock implementation of youtube.API.
func TestSomethingThatUsesAPI(t *testing.T) { // make and configure a mocked youtube.API mockedAPI := &APIMock{ VideoTitleFunc: func(ctx context.Context, u *url.URL) string { panic("mock out the VideoTitle method") }, } // use mockedAPI in code that requires youtube.API // and then make assertions. }
func (*APIMock) VideoTitle ¶
VideoTitle calls VideoTitleFunc.
Click to show internal directories.
Click to hide internal directories.