Files
gocryptotrader/communications/communications_test.go
cranktakular 8cbe99cf2f Telegram testing and race condition fix. (#195)
* Telegram testing and race condition fix.

Improving telegram Setup test
More coverage for telegram PushEvent test
Adding telegram HandleMessages test
Adding telegram GetUpdates test
Adding telegram TestConnection test
Adding telegram SendMessage test
(Hopefully) completely fixed race conditions with slack testing

* Adding testing to communications.go
2018-10-23 15:40:25 +11:00

29 lines
683 B
Go

package communications
import (
"testing"
"github.com/thrasher-/gocryptotrader/config"
)
func TestNewComm(t *testing.T) {
var config config.CommunicationsConfig
communications := NewComm(config)
if len(communications.IComm) != 0 {
t.Errorf("Test failed, communications NewComm, expected len 0, got len %d",
len(communications.IComm))
}
config.TelegramConfig.Enabled = true
config.SMSGlobalConfig.Enabled = true
config.SMTPConfig.Enabled = true
config.SlackConfig.Enabled = true
communications = NewComm(config)
if len(communications.IComm) != 4 {
t.Errorf("Test failed, communications NewComm, expected len 4, got len %d",
len(communications.IComm))
}
}