summaryrefslogtreecommitdiff
path: root/libtmdb/testCallMockApi.cpp
blob: 79efbe28ae4da3ee2d06974f048a61e8c140b505 (plain)
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
#define BOOST_TEST_MODULE CallMockApi
#include <boost/test/unit_test.hpp>

#include "tmdb-proxy.h"

const std::string MockBase = "http://private-5513-themoviedb.apiary-mock.com/3";
const std::string ApiKey = "48b32823d2b60c5c1085af36daed03fa";

BOOST_AUTO_TEST_CASE( search_tmdb )
{
	TMDb::Proxy test(MockBase, ApiKey);
	auto resp = test.SearchMulti("breaking bad", 0, Ice::Current());
	BOOST_REQUIRE_EQUAL(20, resp->Results.size());
	BOOST_REQUIRE_EQUAL(134, resp->TotalResults);
	BOOST_REQUIRE_EQUAL(1396, resp->Results[0]->Id);
	BOOST_REQUIRE_EQUAL(34541, resp->Results[1]->Id);
	BOOST_REQUIRE_EQUAL(332501, resp->Results[19]->Id);
}

BOOST_AUTO_TEST_CASE( get_movie )
{
	TMDb::Proxy test(MockBase, ApiKey);
	auto resp = test.GetMovie(1396, Ice::Current());
	BOOST_REQUIRE_EQUAL("Fight Club", resp->Title);
}