testdriven-3.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);
Debug.debug("%w should be 'false'", this.go);
}
else {
this.setAttribute('text', 'Go');
this.setAttribute('go', true);
Debug.debug("%w should be 'true'", this.go);
}
</handler>
</button>
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
assertTrue(goButton.go);
</method>
<method name="addTests">
this.addTest("testGoButtonTrue");
</method>
</TestCase>
</TestSuite>
</canvas>
Cross References
Includes
Named Instances