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:
parent
50409bb549
commit
a003cd0215
21
send_test.go
21
send_test.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user