-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch_test.go
53 lines (42 loc) · 892 Bytes
/
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
package imdb_test
import (
"testing"
"github.com/Jisin0/filmigo/imdb"
)
var searchQuery string = "mad"
func TestSearchTitles(t *testing.T) {
res, err := c.SearchTitles(searchQuery, &imdb.SearchConfigs{IncludeVideos: true})
if err != nil {
t.Error(err)
t.Failed()
}
t.Logf("%+v", res)
}
func TestSearchAll(t *testing.T) {
res, err := c.SearchAll(searchQuery, &imdb.SearchConfigs{IncludeVideos: true})
if err != nil {
t.Error(err)
t.Failed()
}
t.Logf("%+v", res)
}
func TestSearchNames(t *testing.T) {
res, err := c.SearchNames(searchQuery, &imdb.SearchConfigs{IncludeVideos: true})
if err != nil {
t.Error(err)
t.Failed()
}
t.Logf("%+v", res)
}
func TestFullTitle(t *testing.T) {
r, e := c.SearchTitles(searchQuery)
if e != nil {
t.Error(e)
return
}
res, err := r.Results[0].FullTitle(c)
if err != nil || res == nil {
t.Error(err)
return
}
}