Jump to content

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

From KDE Wiki Sandbox
  • 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);
    }