Documentation
¶
Overview ¶
Package emailtest provides a mock implementation of gas.EmailProvider for use in tests. The mock records all calls and allows configuring per-method behavior via function fields.
mock := &emailtest.MockEmail{}
mock.SendFn = func(ctx context.Context, msg *gas.Email) error {
return nil
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockEmail ¶
type MockEmail struct {
SendFn func(ctx context.Context, msg *gas.Email) error
SendFromTemplateFn func(ctx context.Context, msg *gas.TemplatedEmail) error
CheckReadyFn func(ctx context.Context) error
Calls []Call
// contains filtered or unexported fields
}
MockEmail is a configurable mock of gas.EmailProvider. Each method delegates to its corresponding Fn field if set, otherwise returns the zero value. All calls are recorded in the Calls slice for assertions.
func (*MockEmail) CheckReady ¶
CheckReady records the call and delegates to CheckReadyFn if set.
func (*MockEmail) SendFromTemplate ¶
SendFromTemplate records the call and delegates to SendFromTemplateFn if set.
Click to show internal directories.
Click to hide internal directories.