testdriven-5.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
"/>
<attribute name="counter" type="number" value="1
" when="once"/>
<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>
Cross References
Includes
Named Instances