Skip to content

Commit

Permalink
Update test_server_message_processing.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
bartpomietlo authored Sep 24, 2024
1 parent 056fdb1 commit 043d191
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/test_server_message_processing.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#include <boost/test/unit_test.hpp>
#include "../src/modules/server_message_processing.hpp"
#include "../src/modules/password_checker.hpp"

struct TestUser {
std::string email = "[email protected]";
std::string login = "bart";
std::string password = "qWERTY1!!!";
}user;



BOOST_AUTO_TEST_CASE(TestPositiveNumber) {
BOOST_REQUIRE_EQUAL(to_string_with_precision(2.312, 1), "2.3");
}




BOOST_AUTO_TEST_CASE(TestPasswordEquality){
BOOST_REQUIRE_EQUAL(check_register("[email protected]", "adam", "Admin12345!", "Admin12345!"), "0adam");
BOOST_REQUIRE_EQUAL(check_register("1"+user.email, user.login+"1", user.password, user.password), "The specified email or login already exists!");
BOOST_REQUIRE_EQUAL(check_register("1aa"+user.email, user.login+"111", user.password, user.password+'1'), "Passwords don't match!");
}

0 comments on commit 043d191

Please sign in to comment.