-
Notifications
You must be signed in to change notification settings - Fork 35
/
discover_test.go
47 lines (43 loc) · 1.24 KB
/
discover_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
package tmdb
func (suite *TMBDTestSuite) TestGetDiscoverMovie() {
o := make(map[string]string)
o["language"] = "en-US"
o["include_adult"] = "false"
o["include_video"] = "false"
o["sort_by"] = "popularity.desc"
discover, err := suite.client.GetDiscoverMovie(o)
suite.Nil(err)
suite.NotNil(discover)
}
func (suite *TMBDTestSuite) TestGetDiscoverMovieFail() {
suite.client.apiKey = ""
o := make(map[string]string)
o["language"] = "en-US"
o["include_adult"] = "false"
o["include_video"] = "false"
o["sort_by"] = "popularity.desc"
_, err := suite.client.GetDiscoverMovie(o)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetDiscoverTV() {
o := make(map[string]string)
o["page"] = "1"
o["language"] = "en-US"
o["timezone"] = "America/New_York"
o["sort_by"] = "popularity.desc"
o["include_null_first_air_dates"] = "false"
discover, err := suite.client.GetDiscoverTV(o)
suite.Nil(err)
suite.NotNil(discover)
}
func (suite *TMBDTestSuite) TestGetDiscoverTVFail() {
suite.client.apiKey = ""
o := make(map[string]string)
o["page"] = "1"
o["language"] = "en-US"
o["timezone"] = "America/New_York"
o["sort_by"] = "popularity.desc"
o["include_null_first_air_dates"] = "false"
_, err := suite.client.GetDiscoverTV(o)
suite.NotNil(err)
}