1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
package agimodels
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBuild(t *testing.T) {
for _, test := range []struct {
S string
C Command
}{
{S: "HANGUP 16", C: HangupCommand{}.SetChannelName("16")},
{S: "CONTROL STREAM FILE fn #", C: ControlStreamFileCommand{FileName: "fn", EscapeDigits: "#"}},
{S: "CONTROL STREAM FILE fn #", C: ControlStreamFileCommand{FileName: "fn", EscapeDigits: "#"}.SetPausechr("Abc")},
} {
s, err := test.C.Command()
assert.NoError(t, err)
assert.Equal(t, test.S, s)
}
}
|