~mterry/unity8/greeter-wallpaper

« back to all changes in this revision

Viewing changes to tests/plugins/AccountsService/client.cpp

  • Committer: Michael Terry
  • Date: 2013-09-05 18:09:41 UTC
  • Revision ID: michael.terry@canonical.com-20130905180941-dk6pcbwshq2o27a7
Rename classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Authored by: Michael Terry <michael.terry@canonical.com>
18
18
 */
19
19
 
20
 
#include "AccountsBindings.h"
21
20
#include "AccountsService.h"
 
21
#include "AccountsServiceDBusAdaptor.h"
22
22
#include <QSignalSpy>
23
23
#include <QTest>
24
24
 
31
31
    void testInvalids()
32
32
    {
33
33
        // Test various invalid calls
34
 
        AccountsService session;
 
34
        AccountsServiceDBusAdaptor session;
35
35
        QCOMPARE(session.getUserProperty("NOPE", "com.canonical.unity.AccountsService", "demo-edges"), QVariant());
36
36
        QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "NOPE"), QVariant());
37
37
    }
38
38
 
39
 
    void testGetSetService()
 
39
    void testGetSetServiceDBusAdaptor()
40
40
    {
41
 
        AccountsService session;
 
41
        AccountsServiceDBusAdaptor session;
42
42
        session.setUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges", QVariant(true));
43
43
        QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges"), QVariant(true));
44
44
        session.setUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges", QVariant(false));
45
45
        QCOMPARE(session.getUserProperty("testuser", "com.canonical.unity.AccountsService", "demo-edges"), QVariant(false));
46
46
    }
47
47
 
48
 
    void testGetSetBindings()
 
48
    void testGetSetService()
49
49
    {
50
 
        AccountsBindings bindings;
51
 
        bindings.setUser("testuser");
52
 
        bindings.setDemoEdges(true);
53
 
        QCOMPARE(bindings.getDemoEdges(), true);
54
 
        bindings.setDemoEdges(false);
55
 
        QCOMPARE(bindings.getDemoEdges(), false);
 
50
        AccountsService session;
 
51
        session.setUser("testuser");
 
52
        session.setDemoEdges(true);
 
53
        QCOMPARE(session.getDemoEdges(), true);
 
54
        session.setDemoEdges(false);
 
55
        QCOMPARE(session.getDemoEdges(), false);
56
56
    }
57
57
};
58
58