summaryrefslogtreecommitdiff
path: root/libtmdb/testCallMockApi.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-09-19 23:52:30 +0000
committerrandomdan <randomdan@localhost>2014-09-19 23:52:30 +0000
commit28691c29e93fbc4fdb5ae4866287282840fba021 (patch)
tree8b83ca80afc3f3a5d11b04a56c440d2aa38f4e16 /libtmdb/testCallMockApi.cpp
parentSupport muxing directly in storage (diff)
downloadp2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.tar.bz2
p2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.tar.xz
p2pvr-28691c29e93fbc4fdb5ae4866287282840fba021.zip
First bash at a slicer ice proxy for TMDb and an untested instantiation in p2pvr's core adapter
Diffstat (limited to 'libtmdb/testCallMockApi.cpp')
-rw-r--r--libtmdb/testCallMockApi.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/libtmdb/testCallMockApi.cpp b/libtmdb/testCallMockApi.cpp
new file mode 100644
index 0000000..08719ca
--- /dev/null
+++ b/libtmdb/testCallMockApi.cpp
@@ -0,0 +1,26 @@
+#define BOOST_TEST_MODULE CallMockApi
+#include <boost/test/included/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(3, resp->Results.size());
+ BOOST_REQUIRE_EQUAL(3, resp->TotalResults);
+ BOOST_REQUIRE_EQUAL(1396, resp->Results[0]->Id);
+ BOOST_REQUIRE_EQUAL(239459, resp->Results[1]->Id);
+ BOOST_REQUIRE_EQUAL(19050, resp->Results[2]->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);
+}
+