mirror of
https://github.com/FluuxIO/go-xmpp
synced 2024-11-15 18:13:07 +00:00
33 lines
683 B
Go
33 lines
683 B
Go
package xmpp
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestHandshake(t *testing.T) {
|
|
opts := ComponentOptions{
|
|
Domain: "test.localhost",
|
|
Secret: "mypass",
|
|
}
|
|
c := Component{ComponentOptions: opts}
|
|
|
|
streamID := "1263952298440005243"
|
|
expected := "c77e2ef0109fbbc5161e83b51629cd1353495332"
|
|
|
|
result := c.handshake(streamID)
|
|
if result != expected {
|
|
t.Errorf("incorrect handshake calculation '%s' != '%s'", result, expected)
|
|
}
|
|
}
|
|
|
|
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)
|
|
}
|