testdriven-4.lzx

<canvas debug="true" width="100%">
<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>

<button name="goButton" width="100" text="Go">

<attribute name="go" type="boolean" value="true"/>

<handler name="onclick">
    if (goButton.go==true) {
        this.setAttribute('text', 'Stop');
        this.setAttribute('go', false);
        }
    else {
    this.setAttribute('text', 'Go');
    this.setAttribute('go', true);
    }
</handler>

</button>

<TestSuite>
    <TestCase>
        <method name="testGoButtonTrue">
            assertEquals(1, goButton.counter);
            assertTrue(goButton.go);
        </method>
        <method name="addTests"> 
            this.addTest("testGoButtonTrue");
        </method> 
    </TestCase>   
</TestSuite>

</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Includes

Named Instances