/
farado
/
farado-binara
Обзор
Документация
Войти
/
farado
/
farado-binara
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
tests/elements/test_element_team.cpp
23 строки
691 B
Ostapenko Alexey
[tests] Добавлены тесты элементов предметной области.
20 дек 2023, 18:00
20 дек 2023, 18:00
3c41be2
Код
Авторство
О чём код?
#define BOOST_TEST_MODULE testElementTeam #include <boost/test/unit_test.hpp> #include "common/elements/element_maker.h" #include "common/elements/team.h" BOOST_AUTO_TEST_CASE(testTeamJson) { auto first = std::make_shared<Elements::Team>(); first->setId(1); first->setCaption("a"); first->setDescription("b"); const auto json = first->toJsonString(); const Elements::ElementPtr second(Elements::fromJsonString(json)); BOOST_CHECK(first->isSame(second.get())); const auto third = std::static_pointer_cast<Elements::Team>(second); BOOST_CHECK(1 == third->id()); BOOST_CHECK("a" == third->caption()); BOOST_CHECK("b" == third->description()); }