mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* 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
29 lines
683 B
Go
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))
|
|
}
|
|
}
|