Files
webrtc/icetransportpolicy_test.go
Sean DuBois 2838b1a836 Move ICE code out of internal
Users are unable to use the callbacks inside `internal/ice`.
Even though we alias things like OnSelectedCandidatePairChange
are unusable since in the package they use `ice.Candidate` instead of
`ICECandidate`
2019-06-15 01:29:08 -07:00

44 lines
841 B
Go

package webrtc
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewICETransportPolicy(t *testing.T) {
testCases := []struct {
policyString string
expectedPolicy ICETransportPolicy
}{
{"relay", ICETransportPolicyRelay},
{"all", ICETransportPolicyAll},
}
for i, testCase := range testCases {
assert.Equal(t,
testCase.expectedPolicy,
NewICETransportPolicy(testCase.policyString),
"testCase: %d %v", i, testCase,
)
}
}
func TestICETransportPolicy_String(t *testing.T) {
testCases := []struct {
policy ICETransportPolicy
expectedString string
}{
{ICETransportPolicyRelay, "relay"},
{ICETransportPolicyAll, "all"},
}
for i, testCase := range testCases {
assert.Equal(t,
testCase.expectedString,
testCase.policy.String(),
"testCase: %d %v", i, testCase,
)
}
}