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:
parent
53b6cbf7af
commit
7ba1d4459e
1 changed files with 26 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue