public class DemoRunner extends Sprite
{
public function DemoRunner()
{
super();
XFace.run(this, AllUnits);
}
}
Suite:
[Suite]
// Use "label" to change the display name of the suite.
// [Suite(label="All elements")]
public class AllUnits
{
public var _TextUnit:TextUnit;
public var _ShapeSuite:ShapeSuite;
public var _MinimalSuite:MinimalSuite;
}
Use variables will not have the same order. To have the order use suite method (use "suite" as method name and return an Array with classes):
[Suite]
public class AllUnits
{
public static function suite():Array
{
return [
TextUnit,
ShapeSuite,
MinimalSuite
];
}
}
Unit:
public class PushButtonUnit
{
private var instance:PushButton;
[Before]
public function setUp():void
{
instance = new PushButton();
XFace.display(instance, 10, 30);
}
[Test]
public function toggle_is_false():void
{
instance.label = "Click me";
instance.toggle = false;
}
[Test]
public function toggle_is_true():void
{
instance.label = "Click me";
instance.toggle = true;
instance.selected = true;
}
}
Evan Liu (evancoding@gmail.com)
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/evan-liu/xface