(t *testing.T, s Server)
| 135 | } |
| 136 | |
| 137 | func TestBridgeAddChannel(t *testing.T, s Server) { |
| 138 | key := ari.NewKey(ari.BridgeKey, "bridge1") |
| 139 | |
| 140 | runTest("simple", t, s, func(t *testing.T, m *mock, cl ari.Client) { |
| 141 | m.Bridge.On("AddChannel", key, "channel1").Return(nil) |
| 142 | |
| 143 | err := cl.Bridge().AddChannel(key, "channel1") |
| 144 | if err != nil { |
| 145 | t.Errorf("Unexpected error in remote AddChannel call: %v", err) |
| 146 | } |
| 147 | |
| 148 | m.Shutdown() |
| 149 | |
| 150 | m.Bridge.AssertCalled(t, "AddChannel", key, "channel1") |
| 151 | }) |
| 152 | |
| 153 | runTest("error", t, s, func(t *testing.T, m *mock, cl ari.Client) { |
| 154 | m.Bridge.On("AddChannel", key, "channel1").Return(eris.New("unknown error")) |
| 155 | |
| 156 | err := cl.Bridge().AddChannel(key, "channel1") |
| 157 | if err == nil { |
| 158 | t.Errorf("Expected error to be non-nil") |
| 159 | } |
| 160 | |
| 161 | m.Shutdown() |
| 162 | |
| 163 | m.Bridge.AssertCalled(t, "AddChannel", key, "channel1") |
| 164 | }) |
| 165 | } |
| 166 | |
| 167 | func TestBridgeRemoveChannel(t *testing.T, s Server) { |
| 168 | key := ari.NewKey(ari.BridgeKey, "bridge1") |
no test coverage detected