~ubuntu-clock-dev/ubuntu-clock-app/reboot-packaging

« back to all changes in this revision

Viewing changes to app/tests/unit/tst_hellocomponent.qml

  • Committer: Daniel Holbach
  • Date: 2014-08-05 07:31:06 UTC
  • mfrom: (37.1.1 reboot)
  • Revision ID: daniel.holbach@canonical.com-20140805073106-0gmcmoge080haftu
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.0
2
 
import QtTest 1.0
3
 
import Ubuntu.Components 0.1
4
 
import "../../components"
5
 
 
6
 
// See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html
7
 
 
8
 
// Execute tests with:
9
 
//   qmltestrunner
10
 
 
11
 
Item {
12
 
    // The objects
13
 
    HelloComponent {
14
 
        id: objectUnderTest
15
 
    }
16
 
 
17
 
    TestCase {
18
 
        name: "HelloComponent"
19
 
 
20
 
        function init() {
21
 
            console.debug(">> init");
22
 
            compare("",objectUnderTest.text,"text was not empty on init");
23
 
            console.debug("<< init");
24
 
        }
25
 
 
26
 
        function cleanup() {
27
 
            console.debug(">> cleanup");
28
 
            console.debug("<< cleanup");
29
 
        }
30
 
 
31
 
        function initTestCase() {
32
 
            console.debug(">> initTestCase");
33
 
            console.debug("<< initTestCase");
34
 
        }
35
 
 
36
 
        function cleanupTestCase() {
37
 
            console.debug(">> cleanupTestCase");
38
 
            console.debug("<< cleanupTestCase");
39
 
        }
40
 
 
41
 
        function test_canReadAndWriteText() {
42
 
            var expected = "Hello World";
43
 
 
44
 
            objectUnderTest.text = expected;
45
 
 
46
 
            compare(expected,objectUnderTest.text,"expected did not equal result");
47
 
        }
48
 
    }
49
 
}