Files
webrtc/rtcconfiguration_test.go
2018-07-06 15:23:40 -07:00

21 lines
619 B
Go

package webrtc
import "testing"
func TestRTCICEServer_isStun(t *testing.T) {
testCases := []struct {
expectedType RTCServerType
server RTCICEServer
}{
{RTCServerTypeSTUN, RTCICEServer{URLs: []string{"stun:google.de"}}},
{RTCServerTypeTURN, RTCICEServer{URLs: []string{"turn:google.de"}}},
{RTCServerTypeUnknown, RTCICEServer{URLs: []string{"google.de"}}},
}
for _, testCase := range testCases {
if serverType := testCase.server.serverType(); serverType != testCase.expectedType {
t.Errorf("Expected %q to be %s, but got %s", testCase.server.URLs, testCase.expectedType, serverType)
}
}
}