mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00

Modify RTCSdpType to protect newRTCSdpType Modify RTCPriorityType to protect methods Modify RTCSctpTransportState to protect methods Modify RTCRtcpMuxPolicy to protect methods Modify RTCPeerConnectionState to protect methods Modify RTCIceTransportPolicy to protect methods Modify RTCIceGatheringState to protect methods Modify RTCIceCredentialType to protect methods Modify RTCIceConnectionState to protect methods Modify RTCDtlsTransportState to protect methods Modify RTCDataChannelState to protect methods Modify RTCBundlePolicy to protect methods Relates to #83
46 lines
1011 B
Go
46 lines
1011 B
Go
package webrtc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewRTCIceCredentialType(t *testing.T) {
|
|
testCases := []struct {
|
|
credentialTypeString string
|
|
expectedCredentialType RTCIceCredentialType
|
|
}{
|
|
{"unknown", RTCIceCredentialType(Unknown)},
|
|
{"password", RTCIceCredentialTypePassword},
|
|
{"oauth", RTCIceCredentialTypeOauth},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedCredentialType,
|
|
newRTCIceCredentialType(testCase.credentialTypeString),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|
|
|
|
func TestRTCIceCredentialType_String(t *testing.T) {
|
|
testCases := []struct {
|
|
credentialType RTCIceCredentialType
|
|
expectedString string
|
|
}{
|
|
{RTCIceCredentialType(Unknown), "unknown"},
|
|
{RTCIceCredentialTypePassword, "password"},
|
|
{RTCIceCredentialTypeOauth, "oauth"},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedString,
|
|
testCase.credentialType.String(),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|