Jump to content

Translations:KDevelop5/Manual/Code generation with templates/77/en

From KDE Wiki Sandbox
Revision as of 08:38, 2 April 2020 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • testNumberOfPassengersChanged
    void TestBus::testNumberOfPassengersChanged()
    {
        // create spy object
        QSignalSpy spy1(&m_bus,
                        &Transportation::Bus::numberOfPassengersChanged);
        // now change the number of passengers
        m_bus.setNumberOfPassengers(4);
        // verify the check was made
        QVERIFY(m_bus.numberOfPassengers() == 4);
        // verify the signal was sent
        QCOMPARE(spy1.count(), 1);
    }