diff options
Diffstat (limited to 'tests/test_instanciation.cpp')
-rw-r--r-- | tests/test_instanciation.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/tests/test_instanciation.cpp b/tests/test_instanciation.cpp index 3fbc0f3..3bd73ec 100644 --- a/tests/test_instanciation.cpp +++ b/tests/test_instanciation.cpp @@ -14,7 +14,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "mastodonpp.hpp" +#include "instance.hpp" +#include "request.hpp" #include <catch.hpp> @@ -26,15 +27,33 @@ namespace mastodonpp using std::string; -SCENARIO ("API can be instantiated.") +SCENARIO ("Instantiations.") { bool exception = false; - GIVEN ("One instanciation.") + WHEN ("Instance is instantiated.") { try { - API masto("example.com", ""); + Instance instance{"example.com", ""}; + } + catch (const std::exception &e) + { + exception = true; + } + + THEN ("No exception is thrown") + { + REQUIRE_FALSE(exception); + } + } + + WHEN ("Request is instantiated.") + { + try + { + Instance instance{"example.com", ""}; + Request request{instance}; } catch (const std::exception &e) { |