#include "apiUrl.hpp" #include "hearthstoneApi.hpp" #include #include TEST_CASE("Retrieve API Token", "[getApiToken]") { const std::string kCredentialsFile{"tests/resources/credentials.json"}; Token aToken(kCredentialsFile); const std::string kTokenContent{aToken.text()}; const std::string::size_type kTokenSize{kTokenContent.size()}; REQUIRE(kTokenSize >= 30); REQUIRE(kTokenSize <= 40); } // TEST_CASE("Retrieve number of cards", "[getCardsCount]") { // HearthstoneApiMock aHearthstoneApi; // const std::string kContentType{"cards"}; // const std::string kRegion{"eu"}; // ApiUrl aApiUrl(kContentType, kRegion); // aApiUrl.setLocale("fr_FR"); // aApiUrl.setGameMode("constructed"); // aApiUrl.setPageSize("1"); // std::uint64_t kNumberOfCards{aHearthstoneApi.numberOfCards(aHearthstoneApi.makeApiRequest(aApiUrl()))}; // REQUIRE(kNumberOfCards == 6033); // } // // TEST_CASE("Retrieve cards", "[retrieveCards]") { // HearthstoneApiMock aHearthstoneApi; // const std::string kContentType{"cards"}; // const std::string kRegion{"eu"}; // ApiUrl aApiUrl(kContentType, kRegion); // aApiUrl.setLocale("fr_FR"); // aApiUrl.setGameMode("constructed"); // aApiUrl.setPageSize("10"); // const std::string kApiResponse{aHearthstoneApi.makeApiRequest(aApiUrl())}; // REQUIRE(kApiResponse.size() > 5000); // }