github.com/pion/webrtc/v3@v3.2.24/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 {ICEGathererState(Unknown), unknownStr}, 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 }