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

Function TestPlaybackStop

internal/integration/playback.go:78–105  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

76}
77
78func TestPlaybackStop(t *testing.T, s Server) {
79 key := ari.NewKey(ari.PlaybackKey, "pb1")
80
81 runTest("ok", t, s, func(t *testing.T, m *mock, cl ari.Client) {
82 m.Playback.On("Stop", key).Return(nil)
83
84 err := cl.Playback().Stop(key)
85 if err != nil {
86 t.Errorf("Unexpected error in Playback Stop: %s", err)
87 }
88
89 m.Shutdown()
90
91 m.Playback.AssertCalled(t, "Stop", key)
92 })
93 runTest("err", t, s, func(t *testing.T, m *mock, cl ari.Client) {
94 m.Playback.On("Stop", key).Return(errors.New("error"))
95
96 err := cl.Playback().Stop(key)
97 if err == nil {
98 t.Errorf("Expected error in Playback Stop: %s", err)
99 }
100
101 m.Shutdown()
102
103 m.Playback.AssertCalled(t, "Stop", key)
104 })
105}

Callers 2

TestPlaybackStopFunction · 0.92
TestPlaybackStopFunction · 0.92

Calls 4

runTestFunction · 0.85
PlaybackMethod · 0.80
NewMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected