From 9754c5c1a1701f16c5d166c5da71d160aba23dcf Mon Sep 17 00:00:00 2001 From: Cyro Dubeux Date: Thu, 2 Nov 2023 11:04:56 -0300 Subject: [PATCH] collections tests has been fixed --- collections_test.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/collections_test.go b/collections_test.go index 044fbd8..e2579df 100644 --- a/collections_test.go +++ b/collections_test.go @@ -1,63 +1,65 @@ package tmdb -const starWarsID = 10 +const collectionID = 10 +const collectionIDImage = 2 func (suite *TMBDTestSuite) TestGetCollectionDetails() { - collection, err := suite.client.GetCollectionDetails(starWarsID, nil) + 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(starWarsID, nil) + _, 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(starWarsID, options) + collection, err := suite.client.GetCollectionDetails(collectionID, options) suite.Nil(err) suite.NotNil(collection.ID) } func (suite *TMBDTestSuite) TestGetCollectionImages() { - collection, err := suite.client.GetCollectionImages(starWarsID, nil) + 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(starWarsID, nil) + _, err := suite.client.GetCollectionImages(collectionID, nil) suite.NotNil(err) } func (suite *TMBDTestSuite) TestGetCollectionImagesWithOptions() { options := make(map[string]string) - options["language"] = "pt-BR" - collection, err := suite.client.GetCollectionImages(starWarsID, options) + 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(starWarsID, nil) + 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(starWarsID, nil) + _, 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(starWarsID, options) + collection, err := suite.client.GetCollectionTranslations(collectionID, options) suite.Nil(err) suite.NotNil(collection.ID) }