mirror of
https://github.com/pion/webrtc.git
synced 2025-10-01 13:32:16 +08:00

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`
44 lines
892 B
Go
44 lines
892 B
Go
package webrtc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewICECredentialType(t *testing.T) {
|
|
testCases := []struct {
|
|
credentialTypeString string
|
|
expectedCredentialType ICECredentialType
|
|
}{
|
|
{"password", ICECredentialTypePassword},
|
|
{"oauth", ICECredentialTypeOauth},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedCredentialType,
|
|
newICECredentialType(testCase.credentialTypeString),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|
|
|
|
func TestICECredentialType_String(t *testing.T) {
|
|
testCases := []struct {
|
|
credentialType ICECredentialType
|
|
expectedString string
|
|
}{
|
|
{ICECredentialTypePassword, "password"},
|
|
{ICECredentialTypeOauth, "oauth"},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedString,
|
|
testCase.credentialType.String(),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|