Support Venue Message.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2016-10-14 16:28:40 +08:00
parent b52dcfe9c2
commit 693f15783c
4 changed files with 58 additions and 1 deletions
+23
View File
@@ -75,6 +75,7 @@ func TestSendMessage(t *testing.T) {
Audio: []string{"tests/audio.mp3", "1234", " "},
Voice: []string{"tests/voice.ogg", "1234", " "},
Location: []string{"24.9163213,121.1424972", "1", " "},
Venue: []string{"35.661777,139.704051,竹北體育館,新竹縣竹北市", "24.9163213,121.1424972", "1", " "},
Video: []string{"tests/video.mp4", "1234", " "},
Debug: false,
},
@@ -188,4 +189,26 @@ func TestConvertLocation(t *testing.T) {
Latitude: float64(35.661777),
Longitude: float64(139.704051),
}, result)
input = "35.661777,139.704051,title"
result, empty = convertLocation(input)
assert.Equal(t, false, empty)
assert.Equal(t, Location{
Title: "title",
Address: "",
Latitude: float64(35.661777),
Longitude: float64(139.704051),
}, result)
input = "35.661777,139.704051,title,address"
result, empty = convertLocation(input)
assert.Equal(t, false, empty)
assert.Equal(t, Location{
Title: "title",
Address: "address",
Latitude: float64(35.661777),
Longitude: float64(139.704051),
}, result)
}