Merge lp:~alecu/unity-scope-click/split-department-test into lp:unity-scope-click/devel

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 325
Merged at revision: 337
Proposed branch: lp:~alecu/unity-scope-click/split-department-test
Merge into: lp:unity-scope-click/devel
Diff against target: 48 lines (+19/-9)
1 file modified
scope/tests/test_apps_query.cpp (+19/-9)
To merge this branch: bzr merge lp:~alecu/unity-scope-click/split-department-test
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+227126@code.launchpad.net

Commit message

Split a big test into two, and a few renames to follow coding convention.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Thanks! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scope/tests/test_apps_query.cpp'
2--- scope/tests/test_apps_query.cpp 2014-07-16 13:16:12 +0000
3+++ scope/tests/test_apps_query.cpp 2014-07-16 23:58:23 +0000
4@@ -169,18 +169,21 @@
5 return true;
6 }
7
8-TEST(Query, Departments)
9-{
10+class DepartmentsTest : public ::testing::Test {
11+protected:
12 const std::vector<click::Application> installed_apps = {{"app1", "App1", 0.0f, "icon", "url", "descr", "scrshot"}};
13- const scopes::SearchMetadata metadata("en_EN", "phone");
14- auto clickif = std::make_shared<MockClickInterface>();
15-
16- const scopes::CategoryRenderer renderer("{}");
17- auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
18- auto depts_db = std::make_shared<MockDepartmentsDb>(":memory:");
19-
20+ const scopes::SearchMetadata metadata{"en_EN", "phone"};
21+ const scopes::CategoryRenderer renderer{"{}"};
22 const std::list<std::string> expected_locales {"en_EN", "en_US", ""};
23
24+};
25+
26+TEST_F(DepartmentsTest, testRootDepartment)
27+{
28+ auto clickif = std::make_shared<MockClickInterface>();
29+ auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
30+ auto depts_db = std::make_shared<MockDepartmentsDb>(":memory:");
31+
32 // query for root of the departments tree
33 {
34 const unity::scopes::CannedQuery query("foo.scope", "", "");
35@@ -211,6 +214,13 @@
36
37 q.run(reply);
38 }
39+}
40+
41+TEST_F(DepartmentsTest, testLeafDepartment)
42+{
43+ auto clickif = std::make_shared<MockClickInterface>();
44+ auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
45+ auto depts_db = std::make_shared<MockDepartmentsDb>(":memory:");
46
47 // query for a leaf department
48 {

Subscribers

People subscribed via source and target branches

to all changes: