feat: expose mock email service function
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package email
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net/smtp"
|
||||
"os"
|
||||
@@ -44,19 +43,7 @@ func TestNewConfig_MissingEnvFile(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMockSendEmail(t *testing.T) {
|
||||
service := &EmailService{
|
||||
auth: smtp.PlainAuth("", "", "", ""),
|
||||
host: "",
|
||||
port: "",
|
||||
from: "",
|
||||
tlsconfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
ServerName: "",
|
||||
},
|
||||
dial: func(hostPort string) (SMTPClientIface, error) {
|
||||
return &MockSMTP{}, nil
|
||||
},
|
||||
}
|
||||
service := NewMockMailService()
|
||||
|
||||
emailData := EmailMessage{
|
||||
To: "test@example.com",
|
||||
|
||||
Reference in New Issue
Block a user