Connection test

This commit is contained in:
Jose Garcia 2021-07-28 13:52:30 +00:00 committed by GitHub
parent 39fe550aeb
commit 3a2ade23a4

View file

@ -31,3 +31,11 @@ func TestConnectionInvalid(t *testing.T) {
t.Error(err)
}
}
func TestConnectionURI(t *testing.T) {
conn := Connection{"sess-id", "sess-token", "sas", "sb://endpoint/.net/liveshare"}
uri := conn.uri("connect")
if uri != "wss://endpoint/.net:443/$hc/liveshare?sb-hc-action=connect&sb-hc-token=sas" {
t.Errorf("uri is not correct, got: '%v'", uri)
}
}