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