Files
webrtc/rtcicecredentialtype_test.go
Konstantin Itskov ffbf0aac01 Unexport RTC State, Type and Policy structures
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
2018-09-14 13:42:41 -04:00

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,
)
}
}