Reformat tests.

This commit is contained in:
tastytea 2020-11-13 14:01:09 +01:00
parent 9efc8d2dfd
commit 3a93aec941
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 16 additions and 17 deletions

View File

@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "instance.hpp"
#include "connection.hpp" #include "connection.hpp"
#include "instance.hpp"
#include <catch.hpp> #include <catch.hpp>
@ -24,12 +24,11 @@
namespace mastodonpp namespace mastodonpp
{ {
SCENARIO("mastodonpp::Connection.")
SCENARIO ("mastodonpp::Connection.")
{ {
bool exception = false; bool exception = false;
WHEN ("Connection is instantiated.") WHEN("Connection is instantiated.")
{ {
try try
{ {
@ -41,7 +40,7 @@ SCENARIO ("mastodonpp::Connection.")
exception = true; exception = true;
} }
THEN ("No exception is thrown") THEN("No exception is thrown")
{ {
REQUIRE_FALSE(exception); REQUIRE_FALSE(exception);
} }

View File

@ -26,11 +26,11 @@ namespace mastodonpp
using std::string; using std::string;
SCENARIO ("mastodonpp::html_unescape()") SCENARIO("mastodonpp::html_unescape()")
{ {
bool exception = false; bool exception = false;
WHEN ("html_unescape() is called.") WHEN("html_unescape() is called.")
{ {
string result; string result;
try try
@ -42,8 +42,8 @@ SCENARIO ("mastodonpp::html_unescape()")
exception = true; exception = true;
} }
THEN ("No exception is thrown") THEN("No exception is thrown")
AND_THEN("Result is as expected.") AND_THEN("Result is as expected.")
{ {
REQUIRE_FALSE(exception); REQUIRE_FALSE(exception);
REQUIRE(result == "2€ = 2€ = 2€"); REQUIRE(result == "2€ = 2€ = 2€");

View File

@ -26,11 +26,11 @@ namespace mastodonpp
using std::string; using std::string;
SCENARIO ("mastopp::Instance") SCENARIO("mastopp::Instance")
{ {
bool exception = false; bool exception = false;
WHEN ("Instance is instantiated.") WHEN("Instance is instantiated.")
{ {
try try
{ {
@ -41,13 +41,13 @@ SCENARIO ("mastopp::Instance")
exception = true; exception = true;
} }
THEN ("No exception is thrown") THEN("No exception is thrown")
{ {
REQUIRE_FALSE(exception); REQUIRE_FALSE(exception);
} }
} }
WHEN ("Variables are set.") WHEN("Variables are set.")
{ {
constexpr auto hostname{"likeable.space"}; constexpr auto hostname{"likeable.space"};
constexpr auto proxy{"socks4a://[::1]:9050"}; constexpr auto proxy{"socks4a://[::1]:9050"};
@ -64,10 +64,10 @@ SCENARIO ("mastopp::Instance")
exception = true; exception = true;
} }
THEN ("No exception is thrown") THEN("No exception is thrown")
AND_THEN ("get_access_token() returns the set value.") AND_THEN("get_access_token() returns the set value.")
AND_THEN ("get_hostname() returns the set value.") AND_THEN("get_hostname() returns the set value.")
AND_THEN ("get_baseuri() returns the expected value.") AND_THEN("get_baseuri() returns the expected value.")
{ {
REQUIRE_FALSE(exception); REQUIRE_FALSE(exception);
REQUIRE(instance.get_access_token() == access_token); REQUIRE(instance.get_access_token() == access_token);