/
farado
/
farado-binara
Обзор
Документация
Войти
/
farado
/
farado-binara
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
tests/elements/test_element_project.cpp
27 строк
890 B
Ostapenko Alexey
[common][tests] Поля для поиска заполняются при заполнении основных полей.
25 мар 2024, 18:04
25 мар 2024, 18:04
cc313c4
Код
Авторство
О чём код?
#define BOOST_TEST_MODULE testElementProject #include <boost/test/unit_test.hpp> #include "common/elements/element_maker.h" #include "common/elements/project.h" BOOST_AUTO_TEST_CASE(testProjectJson) { Elements::ProjectPtr first = std::make_shared<Elements::Project>(); first->setId(1); first->setParentId(3); 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::Project>(second); BOOST_CHECK(1 == third->id()); BOOST_CHECK(3 == third->parentId()); BOOST_CHECK("a" == third->caption()); BOOST_CHECK("B" == third->description()); BOOST_CHECK("a" == third->searchCaption()); BOOST_CHECK("b" == third->searchDescription()); }