MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / TestBridgeRemoveChannel

Function TestBridgeRemoveChannel

internal/integration/bridge.go:167–195  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

165}
166
167func TestBridgeRemoveChannel(t *testing.T, s Server) {
168 key := ari.NewKey(ari.BridgeKey, "bridge1")
169
170 runTest("simple", t, s, func(t *testing.T, m *mock, cl ari.Client) {
171 m.Bridge.On("RemoveChannel", key, "channel1").Return(nil)
172
173 err := cl.Bridge().RemoveChannel(key, "channel1")
174 if err != nil {
175 t.Errorf("Unexpected error in remote RemoveChannel call: %v", err)
176 }
177
178 m.Shutdown()
179
180 m.Bridge.AssertCalled(t, "RemoveChannel", key, "channel1")
181 })
182
183 runTest("error", t, s, func(t *testing.T, m *mock, cl ari.Client) {
184 m.Bridge.On("RemoveChannel", key, "channel1").Return(eris.New("unknown error"))
185
186 err := cl.Bridge().RemoveChannel(key, "channel1")
187 if err == nil {
188 t.Errorf("Expected error to be non-nil")
189 }
190
191 m.Shutdown()
192
193 m.Bridge.AssertCalled(t, "RemoveChannel", key, "channel1")
194 })
195}
196
197func TestBridgeDelete(t *testing.T, s Server) {
198 key := ari.NewKey(ari.BridgeKey, "bridge1")

Callers 2

TestBridgeRemoveChannelFunction · 0.92
TestBridgeRemoveChannelFunction · 0.92

Calls 4

runTestFunction · 0.85
RemoveChannelMethod · 0.80
BridgeMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected