MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / themeManagerCRUD

Method themeManagerCRUD

tests/test_theme.cpp:123–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 }
122
123 void themeManagerCRUD() {
124 auto& tm = ThemeManager::instance();
125 int initialCount = tm.themes().size();
126
127 // Add
128 Theme custom = tm.themes()[0];
129 custom.name = "Test Custom";
130 custom.background = QColor("#ff0000");
131 tm.addTheme(custom);
132 QCOMPARE(tm.themes().size(), initialCount + 1);
133 QCOMPARE(tm.themes().last().name, QString("Test Custom"));
134
135 // Update
136 int idx = tm.themes().size() - 1;
137 Theme updated = custom;
138 updated.background = QColor("#00ff00");
139 tm.updateTheme(idx, updated);
140 QCOMPARE(tm.themes()[idx].background, QColor("#00ff00"));
141
142 // Remove
143 tm.removeTheme(idx);
144 QCOMPARE(tm.themes().size(), initialCount);
145 }
146};
147
148QTEST_MAIN(TestTheme)

Callers

nothing calls this directly

Calls 5

themesMethod · 0.80
addThemeMethod · 0.80
updateThemeMethod · 0.80
removeThemeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected