-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp_test.go
44 lines (39 loc) · 916 Bytes
/
app_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
package playstore
import (
"net/http"
"net/url"
"testing"
)
func TestTitle(t *testing.T) {
app, err := LookUp(httpGet, "com.google.android.youtube")
if err != nil {
t.Logf("Error: %s.", err.Error())
} else {
if app.Title != "YouTube" {
t.Error("Expected app title to be the same.")
}
}
}
func TestCategory(t *testing.T) {
app, err := LookUp(httpGet, "com.google.android.youtube")
if err != nil {
t.Logf("Error: %s.", err.Error())
} else {
if app.Category != "Media & Video" {
t.Error("Expected app category to be the same.")
}
}
}
func TestDeveloperName(t *testing.T) {
app, err := LookUp(httpGet, "com.google.android.youtube")
if err != nil {
t.Logf("Error: %s.", err.Error())
} else {
if app.Developer.Name != "Google Inc." {
t.Error("Expected app category to be the same.")
}
}
}
func httpGet(url *url.URL) (*http.Response, error) {
return http.Get(url.String())
}