Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DurationServiceMock ¶
type DurationServiceMock struct { // FileFunc mocks the File method. FileFunc func(fname string) int // contains filtered or unexported fields }
DurationServiceMock is a mock implementation of proc.DurationService.
func TestSomethingThatUsesDurationService(t *testing.T) { // make and configure a mocked proc.DurationService mockedDurationService := &DurationServiceMock{ FileFunc: func(fname string) int { panic("mock out the File method") }, } // use mockedDurationService in code that requires proc.DurationService // and then make assertions. }
func (*DurationServiceMock) File ¶
func (mock *DurationServiceMock) File(fname string) int
File calls FileFunc.
func (*DurationServiceMock) FileCalls ¶
func (mock *DurationServiceMock) FileCalls() []struct { Fname string }
FileCalls gets all the calls that were made to File. Check the length with:
len(mockedDurationService.FileCalls())
type TelegramNotifMock ¶
type TelegramNotifMock struct { // SendFunc mocks the Send method. SendFunc func(chanID string, item feed.Item) error // contains filtered or unexported fields }
TelegramNotifMock is a mock implementation of proc.TelegramNotif.
func TestSomethingThatUsesTelegramNotif(t *testing.T) { // make and configure a mocked proc.TelegramNotif mockedTelegramNotif := &TelegramNotifMock{ SendFunc: func(chanID string, item feed.Item) error { panic("mock out the Send method") }, } // use mockedTelegramNotif in code that requires proc.TelegramNotif // and then make assertions. }
type TelegramSenderMock ¶
type TelegramSenderMock struct { // SendFunc mocks the Send method. SendFunc func(audio tb.Audio, bot *tb.Bot, recipient tb.Recipient, sendOptions *tb.SendOptions) (*tb.Message, error) // contains filtered or unexported fields }
TelegramSenderMock is a mock implementation of proc.TelegramSender.
func TestSomethingThatUsesTelegramSender(t *testing.T) { // make and configure a mocked proc.TelegramSender mockedTelegramSender := &TelegramSenderMock{ SendFunc: func(audio tb.Audio, bot *tb.Bot, recipient tb.Recipient, sendOptions *tb.SendOptions) (*tb.Message, error) { panic("mock out the Send method") }, } // use mockedTelegramSender in code that requires proc.TelegramSender // and then make assertions. }
type TweetPosterMock ¶
type TweetPosterMock struct { // PostTweetFunc mocks the PostTweet method. PostTweetFunc func(msg string, v url.Values) (anaconda.Tweet, error) // contains filtered or unexported fields }
TweetPosterMock is a mock implementation of proc.TweetPoster.
func TestSomethingThatUsesTweetPoster(t *testing.T) { // make and configure a mocked proc.TweetPoster mockedTweetPoster := &TweetPosterMock{ PostTweetFunc: func(msg string, v url.Values) (anaconda.Tweet, error) { panic("mock out the PostTweet method") }, } // use mockedTweetPoster in code that requires proc.TweetPoster // and then make assertions. }
func (*TweetPosterMock) PostTweetCalls ¶
func (mock *TweetPosterMock) PostTweetCalls() []struct { Msg string V url.Values }
PostTweetCalls gets all the calls that were made to PostTweet. Check the length with:
len(mockedTweetPoster.PostTweetCalls())
type TwitterNotifMock ¶
type TwitterNotifMock struct { // SendFunc mocks the Send method. SendFunc func(item feed.Item) error // contains filtered or unexported fields }
TwitterNotifMock is a mock implementation of proc.TwitterNotif.
func TestSomethingThatUsesTwitterNotif(t *testing.T) { // make and configure a mocked proc.TwitterNotif mockedTwitterNotif := &TwitterNotifMock{ SendFunc: func(item feed.Item) error { panic("mock out the Send method") }, } // use mockedTwitterNotif in code that requires proc.TwitterNotif // and then make assertions. }
func (*TwitterNotifMock) Send ¶
func (mock *TwitterNotifMock) Send(item feed.Item) error
Send calls SendFunc.
func (*TwitterNotifMock) SendCalls ¶
func (mock *TwitterNotifMock) SendCalls() []struct { Item feed.Item }
SendCalls gets all the calls that were made to Send. Check the length with:
len(mockedTwitterNotif.SendCalls())
Click to show internal directories.
Click to hide internal directories.