Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifyMock ¶
type NotifyMock struct { // PushNotifyFunc mocks the PushNotify method. PushNotifyFunc func(ctx context.Context, chatId int64, message string) error // StopFunc mocks the Stop method. StopFunc func() // contains filtered or unexported fields }
NotifyMock is a mock implementation of telegram.Notify.
func TestSomethingThatUsesNotify(t *testing.T) { // make and configure a mocked telegram.Notify mockedNotify := &NotifyMock{ PushNotifyFunc: func(ctx context.Context, chatId int64, message string) error { panic("mock out the PushNotify method") }, StopFunc: func() { panic("mock out the Stop method") }, } // use mockedNotify in code that requires telegram.Notify // and then make assertions. }
func (*NotifyMock) PushNotify ¶
PushNotify calls PushNotifyFunc.
func (*NotifyMock) PushNotifyCalls ¶
func (mock *NotifyMock) PushNotifyCalls() []struct { Ctx context.Context ChatId int64 Message string }
PushNotifyCalls gets all the calls that were made to PushNotify. Check the length with:
len(mockedNotify.PushNotifyCalls())
func (*NotifyMock) StopCalls ¶
func (mock *NotifyMock) StopCalls() []struct { }
StopCalls gets all the calls that were made to Stop. Check the length with:
len(mockedNotify.StopCalls())
Click to show internal directories.
Click to hide internal directories.