#include "TestGlobal.hpp" #include using namespace telebotxx; BOOST_AUTO_TEST_SUITE(TestUser) BOOST_AUTO_TEST_CASE(DefaultConstructor) { PRINT_TESTNAME; BOOST_REQUIRE_NO_THROW(User user); } BOOST_AUTO_TEST_CASE(FullConstructor) { PRINT_TESTNAME; int id(1); std::string first("John"); std::string last("Smith"); std::string username("john_smith"); BOOST_REQUIRE_NO_THROW(User user(id, first, last, username)); } BOOST_AUTO_TEST_CASE(CopyConstructor) { PRINT_TESTNAME; User other(1, "John", "Smith", "john_smith"); std::unique_ptr user; BOOST_REQUIRE_NO_THROW(user.reset(new User(other))); BOOST_REQUIRE_EQUAL(user->getId(), 1); BOOST_REQUIRE_EQUAL(user->getFirstName(), "John"); BOOST_REQUIRE_EQUAL(user->getLastName(), "Smith"); BOOST_REQUIRE_EQUAL(user->getUsername(), "john_smith"); } BOOST_AUTO_TEST_CASE(MoveConstructor) { PRINT_TESTNAME; User other(1, "John", "Smith", "john_smith"); std::unique_ptr user; BOOST_REQUIRE_NO_THROW(user.reset(new User(std::move(other)))); BOOST_REQUIRE_EQUAL(user->getId(), 1); BOOST_REQUIRE_EQUAL(user->getFirstName(), "John"); BOOST_REQUIRE_EQUAL(user->getLastName(), "Smith"); BOOST_REQUIRE_EQUAL(user->getUsername(), "john_smith"); } BOOST_AUTO_TEST_SUITE_END()