MCPcopy Index your code
hub / github.com/coder/coder / TestConnectionMethod_Valid

Function TestConnectionMethod_Valid

codersdk/disconnect_test.go:78–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestConnectionMethod_Valid(t *testing.T) {
79 t.Parallel()
80
81 cases := []struct {
82 method codersdk.ConnectionMethod
83 valid bool
84 }{
85 {codersdk.ConnectionMethodUnknown, true},
86 {codersdk.ConnectionMethodDirect, true},
87 {codersdk.ConnectionMethodDERP, true},
88 {codersdk.ConnectionMethod("magic"), false},
89 }
90
91 for _, c := range cases {
92 require.Equal(t, c.valid, c.method.Valid(), "method=%q", c.method)
93 }
94}

Callers

nothing calls this directly

Calls 3

ConnectionMethodTypeAlias · 0.92
ValidMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected