summaryrefslogtreecommitdiffstats
path: root/qx08/source/class/tr/test/DemoTest.js
blob: 0f6a04fffa25ff4464e5b157dd4e6316e6cf462b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* ************************************************************************

   Copyright:

   License:

   Authors:

************************************************************************ */

/**
 * This class demonstrates how to define unit tests for your application.
 *
 * Execute <code>generate.py test</code> to generate a testrunner application 
 * and open it from <tt>test/index.html</tt>
 *
 * The methods that contain the tests are instance methods with a 
 * <code>test</code> prefix. You can create an arbitrary number of test 
 * classes like this one. They can be organized in a regular class hierarchy, 
 * i.e. using deeper namespaces and a corresponding file structure within the 
 * <tt>test</tt> folder.
 */
qx.Class.define("tr.test.DemoTest", {
    extend : qx.dev.unit.TestCase,

    members : {
        /*
            ---------------------------------------------------------------------------
              TESTS
            ---------------------------------------------------------------------------
            */

        /**
         * Here are some simple tests
         *
         * @type member
         * @return {void} 
         */
        testSimple : function() {
            this.assertEquals(4, 3 + 1, "This should never fail!");
            this.assertFalse(false, "Can false be true?!");
        },


        /**
         * Here are some more advanced tests
         *
         * @type member
         * @return {void} 
         */
        testAdvanced : function() {
            var a = 3;
            var b = a;
            this.assertIdentical(a, b, "A rose by any other name is still a rose");
            this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
        }
    }
});