Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotifierMock ¶
type NotifierMock struct {
// SendFunc mocks the Send method.
SendFunc func(ctx context.Context, destination string, text string) error
// contains filtered or unexported fields
}
NotifierMock is a mock implementation of email.Notifier.
func TestSomethingThatUsesNotifier(t *testing.T) {
// make and configure a mocked email.Notifier
mockedNotifier := &NotifierMock{
SendFunc: func(ctx context.Context, destination string, text string) error {
panic("mock out the Send method")
},
}
// use mockedNotifier in code that requires email.Notifier
// and then make assertions.
}
Click to show internal directories.
Click to hide internal directories.