Jump to content

Translations:KDevelop5/Manual/Code generation with templates/78/da

From KDE Wiki Sandbox
Revision as of 11:04, 7 April 2020 by Claus chr (talk | contribs) (Created page with "* testNameOfDriverChanged<syntaxhighlight lang="cpp" line>void TestBus::testNameOfDriverChanged() { // create spy object QSignalSpy spy1(&m_bus, &T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • 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);
        
    }