making custom version of 03g1-debugging with unit test stuff (I think?)

This commit is contained in:
Dan Buch
2010-02-23 20:11:14 -05:00
parent 2333135720
commit 948d15ad6b
5 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package me
{
import mx.core.Application;
import mx.controls.Alert;
import mx.controls.Button;
import flash.events.Event;
import flash.events.MouseEvent;
public class DebuggingApp extends Application
{
public var clickButton:Button;
public function DebuggingApp():void
{
this.addEventListener("creationComplete", initApp);
clickButton = new Button();
clickButton.label = "Click Me";
clickButton.addEventListener("click", showAlert);
this.addChild(clickButton);
}
public function showAlert(event:MouseEvent):void
{
Alert.show('Hello from Flex');
trace("Clickety Click! -> " + event);
}
public function initApp(event:Event):void
{
trace("Hello from Flex Debugging!");
var myVar:Number = 9;
trace("The value of myVar is " + myVar);
}
}
}

View File

@@ -0,0 +1,27 @@
package me.tests
{
import me.Debugging;
import mx.core.Application;
import org.flexunit.listeners.UIListener;
import org.flexunit.runner.TestRunnerBase;
import org.flexunit.runner.FlexUnitCore;
public class TestDebugging extends Application
{
public var uiListener:TestRunnerBase;
private var core:FlexUnitCore;
public function TestDebugging():void
{
this.addEventListener("creationComplete", runMe);
}
public function runMe():void
{
core = new FlexUnitCore();
core.addListener(new UIListener(uiListener));
core.run(Debugging);
}
}
}