Documentation ¶
Index ¶
- type StoreMock
- type YoutubeSvcMock
- func (mock *YoutubeSvcMock) RSSFeed(cinfo youtube.FeedInfo) (string, error)
- func (mock *YoutubeSvcMock) RSSFeedCalls() []struct{ ... }
- func (mock *YoutubeSvcMock) RemoveEntry(entry ytfeed.Entry) error
- func (mock *YoutubeSvcMock) RemoveEntryCalls() []struct{ ... }
- func (mock *YoutubeSvcMock) StoreRSS(chanID string, rss string) error
- func (mock *YoutubeSvcMock) StoreRSSCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoreMock ¶
type StoreMock struct { // LoadFunc mocks the Load method. LoadFunc func(fmFeed string, max int, skipJunk bool) ([]feed.Item, error) // contains filtered or unexported fields }
StoreMock is a mock implementation of api.Store.
func TestSomethingThatUsesStore(t *testing.T) { // make and configure a mocked api.Store mockedStore := &StoreMock{ LoadFunc: func(fmFeed string, max int, skipJunk bool) ([]feed.Item, error) { panic("mock out the Load method") }, } // use mockedStore in code that requires api.Store // and then make assertions. }
type YoutubeSvcMock ¶
type YoutubeSvcMock struct { // RSSFeedFunc mocks the RSSFeed method. RSSFeedFunc func(cinfo youtube.FeedInfo) (string, error) // RemoveEntryFunc mocks the RemoveEntry method. RemoveEntryFunc func(entry ytfeed.Entry) error // StoreRSSFunc mocks the StoreRSS method. StoreRSSFunc func(chanID string, rss string) error // contains filtered or unexported fields }
YoutubeSvcMock is a mock implementation of api.YoutubeSvc.
func TestSomethingThatUsesYoutubeSvc(t *testing.T) { // make and configure a mocked api.YoutubeSvc mockedYoutubeSvc := &YoutubeSvcMock{ RSSFeedFunc: func(cinfo youtube.FeedInfo) (string, error) { panic("mock out the RSSFeed method") }, RemoveEntryFunc: func(entry ytfeed.Entry) error { panic("mock out the RemoveEntry method") }, StoreRSSFunc: func(chanID string, rss string) error { panic("mock out the StoreRSS method") }, } // use mockedYoutubeSvc in code that requires api.YoutubeSvc // and then make assertions. }
func (*YoutubeSvcMock) RSSFeed ¶
func (mock *YoutubeSvcMock) RSSFeed(cinfo youtube.FeedInfo) (string, error)
RSSFeed calls RSSFeedFunc.
func (*YoutubeSvcMock) RSSFeedCalls ¶
func (mock *YoutubeSvcMock) RSSFeedCalls() []struct { Cinfo youtube.FeedInfo }
RSSFeedCalls gets all the calls that were made to RSSFeed. Check the length with:
len(mockedYoutubeSvc.RSSFeedCalls())
func (*YoutubeSvcMock) RemoveEntry ¶
func (mock *YoutubeSvcMock) RemoveEntry(entry ytfeed.Entry) error
RemoveEntry calls RemoveEntryFunc.
func (*YoutubeSvcMock) RemoveEntryCalls ¶
func (mock *YoutubeSvcMock) RemoveEntryCalls() []struct { Entry ytfeed.Entry }
RemoveEntryCalls gets all the calls that were made to RemoveEntry. Check the length with:
len(mockedYoutubeSvc.RemoveEntryCalls())
func (*YoutubeSvcMock) StoreRSS ¶
func (mock *YoutubeSvcMock) StoreRSS(chanID string, rss string) error
StoreRSS calls StoreRSSFunc.
func (*YoutubeSvcMock) StoreRSSCalls ¶
func (mock *YoutubeSvcMock) StoreRSSCalls() []struct { ChanID string Rss string }
StoreRSSCalls gets all the calls that were made to StoreRSS. Check the length with:
len(mockedYoutubeSvc.StoreRSSCalls())
Click to show internal directories.
Click to hide internal directories.