github.com/pion/webrtc/v4@v4.0.1/icegathererstate_test.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 package webrtc 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestICEGathererState_String(t *testing.T) { 13 testCases := []struct { 14 state ICEGathererState 15 expectedString string 16 }{ 17 {ICEGathererStateUnknown, ErrUnknownType.Error()}, 18 {ICEGathererStateNew, "new"}, 19 {ICEGathererStateGathering, "gathering"}, 20 {ICEGathererStateComplete, "complete"}, 21 {ICEGathererStateClosed, "closed"}, 22 } 23 24 for i, testCase := range testCases { 25 assert.Equal(t, 26 testCase.expectedString, 27 testCase.state.String(), 28 "testCase: %d %v", i, testCase, 29 ) 30 } 31 }