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
48 lines
1022 B
Go
48 lines
1022 B
Go
package webrtc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNewRTCBundlePolicy(t *testing.T) {
|
|
testCases := []struct {
|
|
policyString string
|
|
expectedPolicy RTCBundlePolicy
|
|
}{
|
|
{"unknown", RTCBundlePolicy(Unknown)},
|
|
{"balanced", RTCBundlePolicyBalanced},
|
|
{"max-compat", RTCBundlePolicyMaxCompat},
|
|
{"max-bundle", RTCBundlePolicyMaxBundle},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedPolicy,
|
|
newRTCBundlePolicy(testCase.policyString),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|
|
|
|
func TestRTCBundlePolicy_String(t *testing.T) {
|
|
testCases := []struct {
|
|
policy RTCBundlePolicy
|
|
expectedString string
|
|
}{
|
|
{RTCBundlePolicy(Unknown), "unknown"},
|
|
{RTCBundlePolicyBalanced, "balanced"},
|
|
{RTCBundlePolicyMaxCompat, "max-compat"},
|
|
{RTCBundlePolicyMaxBundle, "max-bundle"},
|
|
}
|
|
|
|
for i, testCase := range testCases {
|
|
assert.Equal(t,
|
|
testCase.expectedString,
|
|
testCase.policy.String(),
|
|
"testCase: %d %v", i, testCase,
|
|
)
|
|
}
|
|
}
|