~ahayzen/+junk/u1db-sortfiltermodel-recent-test

« back to all changes in this revision

Viewing changes to tests/unit/tst_hellocomponent.qml

  • Committer: Andrew Hayzen
  • Date: 2014-05-20 06:30:06 UTC
  • Revision ID: ahayzen@gmail.com-20140520063006-p1lw2ct2cd8qxh9t
* U1DB Recent Issue Example

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
}