Move Auto-Type associations handling from Entry into an own class.

This commit is contained in:
Felix Geyer 2012-07-16 09:54:04 +02:00
parent f4a4930f42
commit f98d834edb
9 changed files with 197 additions and 38 deletions

View file

@ -255,8 +255,8 @@ void TestKeePass2XmlReader::testEntry1()
QCOMPARE(entry->autoTypeEnabled(), false);
QCOMPARE(entry->autoTypeObfuscation(), 0);
QCOMPARE(entry->defaultAutoTypeSequence(), QString(""));
QCOMPARE(entry->autoTypeAssociations().size(), 1);
const AutoTypeAssociation assoc1 = entry->autoTypeAssociations().at(0);
QCOMPARE(entry->autoTypeAssociations()->size(), 1);
const AutoTypeAssociations::Association assoc1 = entry->autoTypeAssociations()->get(0);
QCOMPARE(assoc1.window, QString("Target Window"));
QCOMPARE(assoc1.sequence, QString(""));
}
@ -300,11 +300,11 @@ void TestKeePass2XmlReader::testEntry2()
QCOMPARE(entry->autoTypeEnabled(), true);
QCOMPARE(entry->autoTypeObfuscation(), 1);
QCOMPARE(entry->defaultAutoTypeSequence(), QString("{USERNAME}{TAB}{PASSWORD}{ENTER}"));
QCOMPARE(entry->autoTypeAssociations().size(), 2);
const AutoTypeAssociation assoc1 = entry->autoTypeAssociations().at(0);
QCOMPARE(entry->autoTypeAssociations()->size(), 2);
const AutoTypeAssociations::Association assoc1 = entry->autoTypeAssociations()->get(0);
QCOMPARE(assoc1.window, QString("Target Window"));
QCOMPARE(assoc1.sequence, QString("{Title}{UserName}"));
const AutoTypeAssociation assoc2 = entry->autoTypeAssociations().at(1);
const AutoTypeAssociations::Association assoc2 = entry->autoTypeAssociations()->get(1);
QCOMPARE(assoc2.window, QString("Target Window 2"));
QCOMPARE(assoc2.sequence, QString("{Title}{UserName} test"));
}