diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-27 16:13:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-27 16:13:47 +0200 |
commit | 529db49c496f4f668cec3f7c59d2d0ec78c50c9a (patch) | |
tree | b7622a54b4063f4dc735a8b4061525148377b6c9 /tests/accountstest.cpp | |
parent | 577c2c344079c1a87d3d93be5f957e5f2d935bff (diff) | |
download | sink-529db49c496f4f668cec3f7c59d2d0ec78c50c9a.tar.gz sink-529db49c496f4f668cec3f7c59d2d0ec78c50c9a.zip |
Don't hardcode the type property.
Diffstat (limited to 'tests/accountstest.cpp')
-rw-r--r-- | tests/accountstest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp index e0a99c2..260602c 100644 --- a/tests/accountstest.cpp +++ b/tests/accountstest.cpp | |||
@@ -22,8 +22,8 @@ private slots: | |||
22 | 22 | ||
23 | void init() | 23 | void init() |
24 | { | 24 | { |
25 | ConfigStore("accounts").clear(); | 25 | ConfigStore("accounts", "type").clear(); |
26 | ConfigStore("resources").clear(); | 26 | ConfigStore("resources", Sink::ApplicationDomain::SinkResource::ResourceType::name).clear(); |
27 | } | 27 | } |
28 | 28 | ||
29 | void testLoad() | 29 | void testLoad() |
@@ -34,17 +34,17 @@ private slots: | |||
34 | QString accountName("name"); | 34 | QString accountName("name"); |
35 | QString accountIcon("icon"); | 35 | QString accountIcon("icon"); |
36 | auto account = ApplicationDomainType::createEntity<SinkAccount>(); | 36 | auto account = ApplicationDomainType::createEntity<SinkAccount>(); |
37 | account.setProperty("type", "maildir"); | 37 | account.setAccountType("maildir"); |
38 | account.setProperty("name", accountName); | 38 | account.setName(accountName); |
39 | account.setProperty("icon", accountIcon); | 39 | account.setIcon(accountIcon); |
40 | Store::create(account).exec().waitForFinished(); | 40 | Store::create(account).exec().waitForFinished(); |
41 | 41 | ||
42 | Store::fetchAll<SinkAccount>(Query()).syncThen<void, QList<SinkAccount::Ptr>>([&](const QList<SinkAccount::Ptr> &accounts) { | 42 | Store::fetchAll<SinkAccount>(Query()).syncThen<void, QList<SinkAccount::Ptr>>([&](const QList<SinkAccount::Ptr> &accounts) { |
43 | QCOMPARE(accounts.size(), 1); | 43 | QCOMPARE(accounts.size(), 1); |
44 | auto account = accounts.first(); | 44 | auto account = accounts.first(); |
45 | QCOMPARE(account->getProperty("type").toString(), QString("maildir")); | 45 | QCOMPARE(account->getAccountType(), QString("maildir")); |
46 | QCOMPARE(account->getProperty("name").toString(), accountName); | 46 | QCOMPARE(account->getName(), accountName); |
47 | QCOMPARE(account->getProperty("icon").toString(), accountIcon); | 47 | QCOMPARE(account->getIcon(), accountIcon); |
48 | }) | 48 | }) |
49 | .exec().waitForFinished(); | 49 | .exec().waitForFinished(); |
50 | 50 | ||
@@ -52,8 +52,8 @@ private slots: | |||
52 | QString smtpUsername("smtpUsername"); | 52 | QString smtpUsername("smtpUsername"); |
53 | QString smtpPassword("smtpPassword"); | 53 | QString smtpPassword("smtpPassword"); |
54 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); | 54 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); |
55 | resource.setProperty("type", "sink.mailtransport"); | 55 | resource.setResourceType("sink.mailtransport"); |
56 | resource.setProperty("account", account.identifier()); | 56 | resource.setAccount(account); |
57 | resource.setProperty("server", smtpServer); | 57 | resource.setProperty("server", smtpServer); |
58 | resource.setProperty("username", smtpUsername); | 58 | resource.setProperty("username", smtpUsername); |
59 | resource.setProperty("password", smtpPassword); | 59 | resource.setProperty("password", smtpPassword); |
@@ -63,7 +63,7 @@ private slots: | |||
63 | Store::fetchAll<SinkResource>(Query()).syncThen<void, QList<SinkResource::Ptr>>([&](const QList<SinkResource::Ptr> &resources) { | 63 | Store::fetchAll<SinkResource>(Query()).syncThen<void, QList<SinkResource::Ptr>>([&](const QList<SinkResource::Ptr> &resources) { |
64 | QCOMPARE(resources.size(), 1); | 64 | QCOMPARE(resources.size(), 1); |
65 | auto resource = resources.first(); | 65 | auto resource = resources.first(); |
66 | QCOMPARE(resource->getProperty("type").toString(), QString("sink.mailtransport")); | 66 | QCOMPARE(resource->getResourceType(), QByteArray("sink.mailtransport")); |
67 | QCOMPARE(resource->getProperty("server").toString(), smtpServer); | 67 | QCOMPARE(resource->getProperty("server").toString(), smtpServer); |
68 | }) | 68 | }) |
69 | .exec().waitForFinished(); | 69 | .exec().waitForFinished(); |