Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SenderMock ¶
type SenderMock struct {
// SendFunc mocks the Send method.
SendFunc func(from string, to []string, msg []byte) error
// contains filtered or unexported fields
}
SenderMock is a mock implementation of email.Sender.
func TestSomethingThatUsesSender(t *testing.T) {
// make and configure a mocked email.Sender
mockedSender := &SenderMock{
SendFunc: func(from string, to []string, msg []byte) error {
panic("mock out the Send method")
},
}
// use mockedSender in code that requires email.Sender
// and then make assertions.
}
Click to show internal directories.
Click to hide internal directories.