Files
webrtc/icecredentialtype_test.go
Max Hawkins 0647ce9c26 Remove rtc prefix from filenames
Relates to #408
2019-02-17 16:22:56 -08:00

46 lines
980 B
Go

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