golang-lib/mailer/test_test.go

27 lines
396 B
Go
Raw Permalink Normal View History

2021-06-23 20:48:08 +02:00
package mailer
import (
"testing"
"github.com/stretchr/testify/assert"
2021-09-29 13:08:43 +02:00
"go.uber.org/zap"
2021-06-23 20:48:08 +02:00
)
func TestFakeServer(t *testing.T) {
assert := assert.New(t)
s := &Service{
SMTPHost: "127.0.0.1",
SMTPPort: -2,
SMTPUsername: "user",
SMTPPassword: "password",
SMTPSSL: false,
}
// Port
assert.Panics(func() {
2021-09-29 13:08:43 +02:00
mock, _ := newFakeServer(s, zap.L())
2021-06-23 20:48:08 +02:00
mock.Close()
})
}