icegathererstate_test.go 675 B

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