Translations:KDevelop5/Manual/Code generation with templates/78/en: Difference between revisions
Appearance
Importing a new version from external source |
Importing a new version from external source |
||
Line 1: | Line 1: | ||
* testNameOfDriverChanged | * testNameOfDriverChanged<syntaxhighlight lang="cpp" line>void TestBus::testNameOfDriverChanged() | ||
{ | { | ||
// create spy object | // create spy object | ||
Line 11: | Line 11: | ||
QCOMPARE(spy1.count(), 1); | QCOMPARE(spy1.count(), 1); | ||
}</ | }</syntaxhighlight> |
Latest revision as of 08:38, 2 April 2020
- testNameOfDriverChanged
void TestBus::testNameOfDriverChanged() { // create spy object QSignalSpy spy1(&m_bus, &Transportation::Bus::nameOfDriverChanged); // now change the name of driver m_bus.setNameOfDriver(QString("Jim")); // verify the check was made QVERIFY(m_bus.nameOfDriver() == QString("Jim")); // verify the signal was sent QCOMPARE(spy1.count(), 1); }