O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining the second outcome step

This step requires calling into the already implemented method, isSortedBy(const QString& field, const QString& direction) const:

...void Usecases_add_grocery_item::test_item_can_be_added(){    ...    // And the groceries are ordered by name, ascending    QVERIFY(m_groceryItems->isSortedBy("name", "ASC"));}...
As already mentioned, you might prefer to test the sorting by writing an external utility function that works on the list, rather than calling the isSortedBy method.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required