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

Function TestChannelAnswer

internal/integration/channel.go:61–91  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

59}
60
61func TestChannelAnswer(t *testing.T, s Server) {
62 key := ari.NewKey(ari.ChannelKey, "c1")
63
64 runTest("simple", t, s, func(t *testing.T, m *mock, cl ari.Client) {
65 m.Channel.On("Answer", key).Return(nil)
66
67 err := cl.Channel().Answer(key)
68 if err != nil {
69 t.Errorf("Unexpected error in remote Data call %s", err)
70 }
71
72 m.Shutdown()
73
74 m.Channel.AssertCalled(t, "Answer", key)
75 })
76
77 runTest("error", t, s, func(t *testing.T, m *mock, cl ari.Client) {
78 expected := errors.New("Unknown error")
79
80 m.Channel.On("Answer", key).Return(expected)
81
82 err := cl.Channel().Answer(key)
83 if err == nil {
84 t.Errorf("Expected error in remote Answer call")
85 }
86
87 m.Shutdown()
88
89 m.Channel.AssertCalled(t, "Answer", key)
90 })
91}
92
93func TestChannelBusy(t *testing.T, s Server) {
94 key := ari.NewKey(ari.ChannelKey, "c1")

Callers 2

TestChannelAnswerFunction · 0.92
TestChannelAnswerFunction · 0.92

Calls 4

runTestFunction · 0.85
AnswerMethod · 0.80
ChannelMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected