10 Star 38 Fork 19

Gitee 极速下载 / Pion-WebRTC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/pion/webrtc
克隆/下载
rtptransceiverdirection_test.go 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Woodrow Douglass 提交于 2023-09-12 11:39 . Remove the "Unknown" constant
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
package webrtc
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewRTPTransceiverDirection(t *testing.T) {
testCases := []struct {
directionString string
expectedDirection RTPTransceiverDirection
}{
{ErrUnknownType.Error(), RTPTransceiverDirectionUnknown},
{"sendrecv", RTPTransceiverDirectionSendrecv},
{"sendonly", RTPTransceiverDirectionSendonly},
{"recvonly", RTPTransceiverDirectionRecvonly},
{"inactive", RTPTransceiverDirectionInactive},
}
for i, testCase := range testCases {
assert.Equal(t,
NewRTPTransceiverDirection(testCase.directionString),
testCase.expectedDirection,
"testCase: %d %v", i, testCase,
)
}
}
func TestRTPTransceiverDirection_String(t *testing.T) {
testCases := []struct {
direction RTPTransceiverDirection
expectedString string
}{
{RTPTransceiverDirectionUnknown, ErrUnknownType.Error()},
{RTPTransceiverDirectionSendrecv, "sendrecv"},
{RTPTransceiverDirectionSendonly, "sendonly"},
{RTPTransceiverDirectionRecvonly, "recvonly"},
{RTPTransceiverDirectionInactive, "inactive"},
}
for i, testCase := range testCases {
assert.Equal(t,
testCase.direction.String(),
testCase.expectedString,
"testCase: %d %v", i, testCase,
)
}
}
1
https://gitee.com/mirrors/Pion-WebRTC.git
git@gitee.com:mirrors/Pion-WebRTC.git
mirrors
Pion-WebRTC
Pion-WebRTC
master

搜索帮助