-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathuser_agent_test.go
46 lines (38 loc) · 1.09 KB
/
user_agent_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
package kolpa
import (
"reflect"
"testing"
)
func TestUserAgent(t *testing.T) {
k := C()
useragent := k.UserAgent()
typeOfOutput := reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("UserAgent generation is failed.")
}
useragent = k.Chrome()
typeOfOutput = reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Chrome UserAgent generation is failed.")
}
useragent = k.Firefox()
typeOfOutput = reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Firefox UserAgent generation is failed.")
}
useragent = k.Opera()
typeOfOutput = reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Opera UserAgent generation is failed.")
}
useragent = k.Safari()
typeOfOutput = reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("Safari UserAgent generation is failed.")
}
useragent = k.InternetExplorer()
typeOfOutput = reflect.TypeOf(useragent).Kind()
if typeOfOutput != reflect.String {
t.Errorf("InternetExplorer UserAgent generation is failed.")
}
}