This commit is contained in:
yun
2026-08-15 01:38:05 +08:00
parent 139330aee2
commit eb8f660ab5
57 changed files with 5401 additions and 1438 deletions
+28
View File
@@ -0,0 +1,28 @@
package mailgun
import (
"context"
"testing"
mailx "code.yun.ink/pkg/mailx"
)
var _ mailx.Sender = (*MailGun)(nil)
func TestName(t *testing.T) {
if got := New(Config{}).Name(); got != "mailgun" {
t.Errorf("Name() = %q, want mailgun", got)
}
}
func TestSendWithoutSender(t *testing.T) {
// 缺少 Sender 时应立即报错,不调用 mailgun SDK
g := New(Config{})
err := g.Send(context.Background(), mailx.NewMessage().
To("a@b.com").
Subject("s").
Build())
if err == nil {
t.Fatal("Send without sender should error")
}
}