Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailSenderMock ¶
type EmailSenderMock struct {
// GetDefaultFromNameFunc mocks the GetDefaultFromName method.
GetDefaultFromNameFunc func() string
// SendFunc mocks the Send method.
SendFunc func(ctx context.Context, req email.Request) error
// contains filtered or unexported fields
}
EmailSenderMock is a mock implementation of server.EmailSender.
func TestSomethingThatUsesEmailSender(t *testing.T) {
// make and configure a mocked server.EmailSender
mockedEmailSender := &EmailSenderMock{
GetDefaultFromNameFunc: func() string {
panic("mock out the GetDefaultFromName method")
},
SendFunc: func(ctx context.Context, req email.Request) error {
panic("mock out the Send method")
},
}
// use mockedEmailSender in code that requires server.EmailSender
// and then make assertions.
}
func (*EmailSenderMock) GetDefaultFromName ¶
func (mock *EmailSenderMock) GetDefaultFromName() string
GetDefaultFromName calls GetDefaultFromNameFunc.
func (*EmailSenderMock) GetDefaultFromNameCalls ¶
func (mock *EmailSenderMock) GetDefaultFromNameCalls() []struct { }
GetDefaultFromNameCalls gets all the calls that were made to GetDefaultFromName. Check the length with:
len(mockedEmailSender.GetDefaultFromNameCalls())
Click to show internal directories.
Click to hide internal directories.