~josharenson/+junk/trustStoreDialogFocusTest

« back to all changes in this revision

Viewing changes to tests/unit/tst_hellocomponent.qml

  • Committer: Josh Arenson
  • Date: 2015-08-12 19:33:12 UTC
  • Revision ID: joshua.arenson@canonical.com-20150812193312-5hu2u0oc86k3in4i
Rework app to leech off the clock app rather than media player

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 1.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
 
}
50