Files
ice/usecandidate_test.go
Aleksandr Razumov d895187fa4 Prepare for stun v2
Using github.com/gortc/stun for now.
Should be easy to change it later.
2019-05-21 15:53:04 -07:00

25 lines
431 B
Go

package ice
import (
"testing"
"github.com/gortc/stun"
)
func TestUseCandidateAttr_AddTo(t *testing.T) {
m := new(stun.Message)
if UseCandidate.IsSet(m) {
t.Error("should not be set")
}
if err := m.Build(stun.BindingRequest, UseCandidate); err != nil {
t.Error(err)
}
m1 := new(stun.Message)
if _, err := m1.Write(m.Raw); err != nil {
t.Error(err)
}
if !UseCandidate.IsSet(m1) {
t.Error("should be set")
}
}