MCPcopy Create free account
hub / github.com/pion/ice / testBooleanOption

Function testBooleanOption

agent_options_test.go:30–61  ·  view source on GitHub ↗
(t *testing.T, test booleanOptionTest, optionName string)

Source from the content-addressed store, hash-verified

28}
29
30func testBooleanOption(t *testing.T, test booleanOptionTest, optionName string) {
31 t.Helper()
32
33 t.Run("enables "+optionName, func(t *testing.T) {
34 agent, err := NewAgentWithOptions(test.optionFunc())
35 assert.NoError(t, err)
36 defer agent.Close() //nolint:errcheck
37
38 assert.True(t, test.getValue(agent))
39 })
40
41 t.Run("default is false", func(t *testing.T) {
42 agent, err := NewAgentWithOptions()
43 assert.NoError(t, err)
44 defer agent.Close() //nolint:errcheck
45
46 assert.False(t, test.getValue(agent))
47 })
48
49 t.Run("works with config", func(t *testing.T) {
50 config := &AgentConfig{
51 NetworkTypes: []NetworkType{NetworkTypeUDP4},
52 }
53 test.configSetter(config, true)
54
55 agent, err := NewAgent(config)
56 assert.NoError(t, err)
57 defer agent.Close() //nolint:errcheck
58
59 assert.True(t, test.getValue(agent))
60 })
61}
62
63func TestDefaultNominationValueGenerator(t *testing.T) {
64 t.Run("generates incrementing values", func(t *testing.T) {

Calls 4

CloseMethod · 0.95
NewAgentWithOptionsFunction · 0.85
NewAgentFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…