Ubuntu Pastebin

Paste from pete-woods at Wed, 25 Feb 2015 10:52:53 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
    void testLeafActivationUpdatesModel()
    {
        m_resultsView->setActiveScope("mock-scope-departments");
        m_resultsView->setQuery("");

        auto books = m_resultsView->browseDepartment("books");
        QCOMPARE(m_resultsView->departmentId(), string("books"));
        QVERIFY(!books.isRoot());

        QVERIFY_MATCHRESULT(
            shm::CategoryListMatcher()
                .hasAtLeast(1)
                .mode(shm::CategoryListMatcher::Mode::starts_with)
                .category(shm::CategoryMatcher("cat1")
                    .hasAtLeast(1)
                    .mode(shm::CategoryMatcher::Mode::starts_with)
                    .result(shm::ResultMatcher("test:uri")
                        .title("result for: \"\", department \"books\"")
                    )
                )
                .match(m_resultsView->categories())
        );

        auto booksAudio = m_resultsView->browseDepartment("books-audio");
        QVERIFY(!booksAudio.isRoot());

        QVERIFY_MATCHRESULT(
            shm::CategoryListMatcher()
                .hasAtLeast(1)
                .mode(shm::CategoryListMatcher::Mode::starts_with)
                .category(shm::CategoryMatcher("cat1")
                    .hasAtLeast(1)
                    .mode(shm::CategoryMatcher::Mode::starts_with)
                    .result(shm::ResultMatcher("test:uri")
                        .title("result for: \"\", department \"books-audio\"")
                    )
                )
                .match(m_resultsView->categories())
        );

        QVERIFY_MATCHRESULT(
            shm::DepartmentMatcher()
                .mode(shm::DepartmentMatcher::Mode::by_id)
                .child(shm::ChildDepartmentMatcher("books-audio"))
                .match(books)
        );
    }
Download as text