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

« back to all changes in this revision

Viewing changes to tests/unit/tst_hellocomponent.qml

  • Committer: carla-sella
  • Date: 2014-07-31 16:58:56 UTC
  • mto: (37.1.1 reboot)
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: carla.sella@gmail.com-20140731165856-o2g4v4z7ivk9864v
Implemented locale.

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
}