Files
webrtc/icecredentialtype_test.go
Sean DuBois 234927366e Default ICECredentialType to password
https://www.w3.org/TR/webrtc/#dom-rtciceserver has the following default
```
credentialType = "password";
```

Update our enum to match that, currently we require users to specify
password
2019-05-25 16:29:33 -07:00

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