Files
gocryptotrader/communications/smtpservice/smtpservice_test.go
Adrian Gallagher f0d45aa1d2 golangci-lint/CI: Bump versions and introduce new linters (#798)
* golangci-lint/CI: Bump versions

Fix remaining linter issues

* Specifically set AppVeyor version

* Fix the infamous typos 👀

* Add go env cmd to AppVeyor

* Add go version cmd to AppVeyor

* Specify AppVeyor image, adjust linters

* Update go get to go install due to deprecation

* Bump golangci-lint timeout time for AppVeyor

* Change NW contract to NQ

* Address nitters

* GetRandomPair -> Pair{}

* Address nits

* Address time nitterinos plus additional tweaks

* More time inception upgrades!

* Bending time and space
2021-10-14 16:38:53 +11:00

42 lines
867 B
Go

package smtpservice
import (
"testing"
"github.com/thrasher-corp/gocryptotrader/communications/base"
"github.com/thrasher-corp/gocryptotrader/config"
)
var s SMTPservice
func TestSetup(t *testing.T) {
t.Parallel()
cfg := &config.Config{Communications: base.CommunicationsConfig{}}
commsCfg := cfg.GetCommunicationsConfig()
s.Setup(&commsCfg)
}
func TestConnect(t *testing.T) {
if err := s.Connect(); err != nil {
t.Error("smtpservice Connect() error", err)
}
}
func TestPushEvent(t *testing.T) {
err := s.PushEvent(base.Event{})
if err == nil {
t.Error("smtpservice PushEvent() error cannot be nil")
}
}
func TestSend(t *testing.T) {
err := s.Send("", "")
if err == nil {
t.Error("smtpservice Send() error cannot be nil")
}
err = s.Send("subject", "alertmessage")
if err == nil {
t.Error("smtpservice Send() error cannot be nil")
}
}