TEST(IdsTest, gettersTest) { Id id = Id::loadFromString("qrm:/editor/diagram/element/id"); EXPECT_EQ(id.editor(), "editor"); EXPECT_EQ(id.diagram(), "diagram"); EXPECT_EQ(id.element(), "element"); EXPECT_EQ(id.id(), "id"); EXPECT_EQ(id.type() ,Id("editor", "diagram", "element")); }
LabelGenerator::LabelGenerator(const qrRepo::RepoApi &repo , GeneratorCustomizer &customizer , const Id &id , QObject *parent) : BindingGenerator(repo, customizer, id, "label.t" , { Binding::createStaticConverting("@@ID@@", id.id() , customizer.factory()->nameNormalizerConverter()) } , parent) { }
std::string idToString(const Id &id) { TRACE(std::cout, ""); return std::string("Id: {\nid: ") .append(string_utils::toString<int>(id.id())) .append("\n}\n"); }
TEST(IdsTest, createElementIdTest) { Id id = Id::createElementId("diagram", "editor", "element"); EXPECT_TRUE(id.id() != ""); }