1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-02-03 13:01:26 +02:00

test(send): test sending messages to multiple servives

This commit is contained in:
Niko Köser 2022-09-12 08:51:06 +02:00
parent 50409bb549
commit a003cd0215
No known key found for this signature in database
GPG Key ID: F3F28C118DAA6375

View File

@ -60,3 +60,24 @@ func TestNotifySend(t *testing.T) {
t.Errorf("Send() with nil service panicked: %v", r)
}
}
func TestSendMany(t *testing.T) {
t.Parallel()
n := New()
if n == nil {
t.Fatal("New() returned nil")
}
var services []Notifier
for i := 0; i < 10; i++ {
services = append(services, mail.New("", ""))
}
n.UseServices(services...)
if err := n.Send(context.Background(), "subject", "message"); err == nil {
t.Errorf("Send() invalid mail returned no error: %v", err)
}
}