Browse Source

cleanup of style

master
Jørgen Lien Sellæg 9 years ago
parent
commit
5f75dd251d
  1. 4
      toREST/tests/include/ServerContext.hpp
  2. 3
      toREST/tests/include/SessionContext.hpp
  3. 6
      toREST/tests/torrents_test.cpp

4
toREST/tests/include/ServerContext.hpp

@ -1,9 +1,9 @@
#ifndef _TR_TEST_SERVER_CONTEXT_HPP_ #ifndef _TR_TEST_SERVER_CONTEXT_HPP_
#define _TR_TEST_SERVER_CONTEXT_HPP_ #define _TR_TEST_SERVER_CONTEXT_HPP_
#include <sstream>
#include <memory>
#include <Catch/fakeit.hpp> #include <Catch/fakeit.hpp>
#include <json.hpp> #include <json.hpp>
#include <memory>
#include <sstream>
class TestRequest { class TestRequest {
public: public:

3
toREST/tests/include/SessionContext.hpp

@ -1,9 +1,9 @@
#ifndef _TR_TEST_SESSION_CONTEXT_HPP_ #ifndef _TR_TEST_SESSION_CONTEXT_HPP_
#define _TR_TEST_SESSION_CONTEXT_HPP_ #define _TR_TEST_SESSION_CONTEXT_HPP_
#include <TorrentContext.hpp>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <TorrentContext.hpp>
class TestSessionSettings { class TestSessionSettings {
public: public:
@ -21,7 +21,6 @@ public:
int get_int(int type) const; int get_int(int type) const;
bool get_bool(int type); bool get_bool(int type);
std::string get_str(int type); std::string get_str(int type);
}; };
class TestSession { class TestSession {

6
toREST/tests/torrents_test.cpp

@ -11,8 +11,7 @@ const nlohmann::json torrent = {
{"seeding", false}, {"seeding", false},
{"state", 0}, {"state", 0},
{"priority", 0}, {"priority", 0},
{"name", "Arch"} {"name", "Arch"}};
};
SCENARIO("We are running a GET /session/torrents resource") { SCENARIO("We are running a GET /session/torrents resource") {
auto torrent_session = TestSession(); auto torrent_session = TestSession();
@ -41,9 +40,8 @@ SCENARIO("We are running a GET /session/torrents resource") {
THEN("the server should reply with an array of torrents") { THEN("the server should reply with an array of torrents") {
tr::session::torrents::get(torrent_session, response, request); tr::session::torrents::get(torrent_session, response, request);
CommonResponse::ok(response, {{"torrents", {torrent}}}); CommonResponse::ok(response, {{"torrents", {torrent}}});
};
} }
} }
} }
} }
}
Loading…
Cancel
Save