mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-12-17 14:02:04 -08:00
20 lines
422 B
Go
20 lines
422 B
Go
|
package xmpp
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestClient_Send(t *testing.T) {
|
||
|
buffer := bytes.NewBufferString("")
|
||
|
client := Client{}
|
||
|
data := []byte("https://da.wikipedia.org/wiki/J%C3%A6vnd%C3%B8gn")
|
||
|
if err := client.sendWithWriter(buffer, data); err != nil {
|
||
|
t.Errorf("Writing failed: %v", err)
|
||
|
}
|
||
|
|
||
|
if buffer.String() != string(data) {
|
||
|
t.Errorf("Incorrect value sent to buffer: '%s'", buffer.String())
|
||
|
}
|
||
|
}
|