Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotAPIMock ¶
type BotAPIMock struct { // SendFunc mocks the Send method. SendFunc func(c tbapi.Chattable) (tbapi.Message, error) // contains filtered or unexported fields }
BotAPIMock is a mock implementation of sender.BotAPI.
func TestSomethingThatUsesBotAPI(t *testing.T) { // make and configure a mocked sender.BotAPI mockedBotAPI := &BotAPIMock{ SendFunc: func(c tbapi.Chattable) (tbapi.Message, error) { panic("mock out the Send method") }, } // use mockedBotAPI in code that requires sender.BotAPI // and then make assertions. }
func (*BotAPIMock) ResetCalls ¶
func (mock *BotAPIMock) ResetCalls()
ResetCalls reset all the calls that were made to all mocked methods.
func (*BotAPIMock) ResetSendCalls ¶
func (mock *BotAPIMock) ResetSendCalls()
ResetSendCalls reset all the calls that were made to Send.
func (*BotAPIMock) SendCalls ¶
func (mock *BotAPIMock) SendCalls() []struct { C tbapi.Chattable }
SendCalls gets all the calls that were made to Send. Check the length with:
len(mockedBotAPI.SendCalls())
Click to show internal directories.
Click to hide internal directories.