-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathcollections_test.go
65 lines (55 loc) · 1.92 KB
/
collections_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
58
59
60
61
62
63
64
65
package tmdb
const collectionID = 10
const collectionIDImage = 10
func (suite *TMBDTestSuite) TestGetCollectionDetails() {
collection, err := suite.client.GetCollectionDetails(collectionID, nil)
suite.Nil(err)
suite.NotNil(collection.ID)
}
func (suite *TMBDTestSuite) TestGetCollectionDetailsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetCollectionDetails(collectionID, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetCollectionDetailsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
collection, err := suite.client.GetCollectionDetails(collectionID, options)
suite.Nil(err)
suite.NotNil(collection.ID)
}
func (suite *TMBDTestSuite) TestGetCollectionImages() {
collection, err := suite.client.GetCollectionImages(collectionIDImage, nil)
suite.Nil(err)
suite.NotNil(collection.ID)
}
func (suite *TMBDTestSuite) TestGetCollectionImagesFail() {
suite.client.apiKey = ""
_, err := suite.client.GetCollectionImages(collectionID, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetCollectionImagesWithOptions() {
options := make(map[string]string)
options["language"] = "en-US"
options["language"] = "en"
collection, err := suite.client.GetCollectionImages(collectionIDImage, options)
suite.Nil(err)
suite.NotNil(collection.ID)
}
func (suite *TMBDTestSuite) TestGetCollectionTranslations() {
collection, err := suite.client.GetCollectionTranslations(collectionID, nil)
suite.Nil(err)
suite.NotNil(collection.ID)
}
func (suite *TMBDTestSuite) TestGetCollectionTranslationsFail() {
suite.client.apiKey = ""
_, err := suite.client.GetCollectionTranslations(collectionID, nil)
suite.NotNil(err)
}
func (suite *TMBDTestSuite) TestGetCollectionTranslationsWithOptions() {
options := make(map[string]string)
options["language"] = "pt-BR"
collection, err := suite.client.GetCollectionTranslations(collectionID, options)
suite.Nil(err)
suite.NotNil(collection.ID)
}