diff --git a/autotests/profilemanagertest.cpp b/autotests/profilemanagertest.cpp index f189cf8..98b613c 100644 --- a/autotests/profilemanagertest.cpp +++ b/autotests/profilemanagertest.cpp @@ -21,6 +21,32 @@ private Q_SLOTS: QCOMPARE(profileManager.rowCount({}), 1); QCOMPARE(profileManager.numProfiles(), 1); QVERIFY(!profileManager.canDelete(profileManager.getProfile(0))); // the first profile can never be deleted + + auto profile = profileManager.getProfile(0); + + QCOMPARE(profileManager.getProfileByUUID(profile->uuid()), profile); + QCOMPARE(profileManager.getProfileIndex(profile->uuid()), 0); + + QVERIFY(!profileManager.hasAnyExistingInstallations()); + } + + void testProfileManagement() + { + ProfileManager profileManager; + + QCOMPARE(profileManager.rowCount({}), 0); + profileManager.load(); + + profileManager.addProfile(); + + QCOMPARE(profileManager.rowCount({}), 2); + QCOMPARE(profileManager.numProfiles(), 2); + QVERIFY(profileManager.canDelete(profileManager.getProfile(1))); + + profileManager.deleteProfile(profileManager.getProfile(1)); + + QCOMPARE(profileManager.rowCount({}), 1); + QCOMPARE(profileManager.numProfiles(), 1); } };