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

Implementing usecases and entities

This can be expressed in code in many ways. Here is one:

Try and come up with your own API for the entities and usecases involved in this scenario before looking at the suggested one! Also, remember that since we are only implementing one test, the code does not contain special provisions for deallocating the objects at the end of the test. If you add more tests, you will have to take care of this aspect too.
void Usecases_add_panel_to_page::test_no_panels(){    // Given there is a page    auto page = new entities::Page(this);    QVERIFY(page);    // And the page has no panels    QCOMPARE(page->panels().count(), 0);    // And the page has size 480 x 480 px    page->setSize(QSize(480,480)); QCOMPARE(page->size(),QSize(480,480)); ...

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