-
Notifications
You must be signed in to change notification settings - Fork 0
/
search_test.go
57 lines (52 loc) · 1.17 KB
/
search_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
package githubscraper
import (
"testing"
)
func TestScraper_SearchRepositories(t *testing.T) {
t.Run("Test SearchRepositories", func(t *testing.T) {
s := New()
count := 0
for _ = range s.SearchRepositories(DefaultSortOption, "go", 20) {
count++
}
if count < 20 {
t.Fatal("SearchRepositories faild. Can't get 20 items.")
}
})
}
func TestScraper_SearchCommits(t *testing.T) {
t.Run("Test SearchCommits", func(t *testing.T) {
s := New()
count := 0
for _ = range s.SearchCommits(DefaultSortOption, "go", 20) {
count++
}
if count < 20 {
t.Fatal("SearchCommits faild. Can't get 20 items.")
}
})
}
func TestScraper_SearchIssues(t *testing.T) {
t.Run("Test SearchIssues", func(t *testing.T) {
s := New()
count := 0
for _ = range s.SearchIssues(DefaultSortOption, "go", 20) {
count++
}
if count < 20 {
t.Fatal("SearchIssues faild. Can't get 20 items.")
}
})
}
func TestScraper_SearchUsers(t *testing.T) {
t.Run("Test SearchUsers", func(t *testing.T) {
s := New()
count := 0
for _ = range s.SearchUsers(DefaultSortOption, "go", 20) {
count++
}
if count < 20 {
t.Fatal("SearchUsers faild. Can't get 20 items.")
}
})
}