-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse_test.go
42 lines (34 loc) · 951 Bytes
/
response_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package alexa
import (
"encoding/json"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestPlainSpeech_MarshalJSON(t *testing.T) {
Convey(`Given I have a PlainSpeech instance`, t, func() {
var t PlainSpeech = `Test "Text"`
Convey(`When I marshal it to JSON`, func() {
output, err := json.Marshal(t)
if err != nil {
panic(err)
}
Convey(`Then the resulting JSON will be correct`, func() {
So(string(output), ShouldEqual, `{"type":"PlainText","text":"Test \"Text\""}`)
})
})
})
}
func TestSSMLSpeech_MarshalJSON(t *testing.T) {
Convey(`Given I have a SSMLSpeech instance`, t, func() {
var t SSMLSpeech = `Test "Text"`
Convey(`When I marshal it to JSON`, func() {
output, err := json.Marshal(t)
if err != nil {
panic(err)
}
Convey(`Then the resulting JSON will be correct`, func() {
So(string(output), ShouldEqual, `{"type":"SSML","ssml":"Test \"Text\""}`)
})
})
})
}