mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-20 22:06:31 +00:00
bd321af29f
* new PR tasks * add homebox to know words * formatting * bump deps * generate db models * ts errors * drop id * fix accessor * drop unused time field * change CI * add expected error * add type check * resolve serveral type errors * hoise in CI
39 lines
630 B
Go
39 lines
630 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_MailerReady_Success(t *testing.T) {
|
|
mc := &MailerConf{
|
|
Host: "host",
|
|
Port: 1,
|
|
Username: "username",
|
|
Password: "password",
|
|
From: "from",
|
|
}
|
|
|
|
assert.True(t, mc.Ready())
|
|
}
|
|
|
|
func Test_MailerReady_Failure(t *testing.T) {
|
|
mc := &MailerConf{}
|
|
assert.False(t, mc.Ready())
|
|
|
|
mc.Host = "host"
|
|
assert.False(t, mc.Ready())
|
|
|
|
mc.Port = 1
|
|
assert.False(t, mc.Ready())
|
|
|
|
mc.Username = "username"
|
|
assert.False(t, mc.Ready())
|
|
|
|
mc.Password = "password"
|
|
assert.False(t, mc.Ready())
|
|
|
|
mc.From = "from"
|
|
assert.True(t, mc.Ready())
|
|
}
|