-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain_test.go
63 lines (53 loc) · 1.18 KB
/
main_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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"testing"
)
const (
testToken = "0:AAHderikGFEtiTE4f"
testTimeout = 60
testDebug = true
)
func init() {
ChatID = 0
initBot(testToken, testTimeout, testDebug)
}
func TestSendMessage(t *testing.T) {
message = "test message"
sendMessage(message)
}
func TestSendPhoto(t *testing.T) {
caption = "Fuji Mountain"
filename = "test/fuji.jpg"
filetype = "photo"
sendFile(filename, filetype, caption)
}
func TestSendVideo(t *testing.T) {
caption = "animation.mp4"
filename = "test/sunrise.mp4"
filetype = "video"
sendFile(filename, filetype, caption)
}
func TestSendAnimation(t *testing.T) {
caption = "animation"
filename = "test/sunrise.mp4"
filetype = "animation"
sendFile(filename, filetype, caption)
}
func TestSendSticker(t *testing.T) {
caption = "sticker.mp4"
filename = "test/sunrise.mp4"
filetype = "sticker"
sendFile(filename, filetype, caption)
}
func TestSendDocument(t *testing.T) {
caption = "King Lear.pdf"
filename = "test/king-lear.pdf"
filetype = "document"
sendFile(filename, filetype, caption)
}
func TestSendLocation(t *testing.T) {
location = true
latitude = -33.8688
longitude = 151.2093
sendLocation(latitude, longitude)
}