go-xmpp/component_test.go

33 lines
683 B
Go
Raw Normal View History

package xmpp
import (
"testing"
)
func TestHandshake(t *testing.T) {
2019-06-08 17:47:05 +00:00
opts := ComponentOptions{
Domain: "test.localhost",
Secret: "mypass",
}
2019-06-08 17:47:05 +00:00
c := Component{ComponentOptions: opts}
streamID := "1263952298440005243"
expected := "c77e2ef0109fbbc5161e83b51629cd1353495332"
2018-01-12 17:14:41 +00:00
result := c.handshake(streamID)
if result != expected {
t.Errorf("incorrect handshake calculation '%s' != '%s'", result, expected)
}
}
2018-01-25 22:16:55 +00:00
func TestGenerateHandshake(t *testing.T) {
// TODO
}
// Test that NewStreamManager can accept a Component.
//
// This validates that Component conforms to StreamClient interface.
func TestStreamManager(t *testing.T) {
NewStreamManager(&Component{}, nil)
}