1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-06-07 14:37:45 +00:00

Add tests for more profile management

Adding and removing profiles, and some of the profile index functions.
This commit is contained in:
Joshua Goins 2024-08-22 18:29:38 -04:00
parent 53b6cbf7af
commit 7ba1d4459e

View file

@ -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);
}
};