Skip to content

Instantly share code, notes, and snippets.

@mia-0032
Created May 9, 2013 04:59
Show Gist options
  • Save mia-0032/5545651 to your computer and use it in GitHub Desktop.
Save mia-0032/5545651 to your computer and use it in GitHub Desktop.
Adobe FlexプロジェクトでHelloWorldとUnitTest
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:Button label="Hello World!!" click="clickButton()" />
<fx:Script>
import mx.controls.Alert;
public function clickButton():Boolean {
Alert.show("Hello World!!");
return true;
}
</fx:Script>
</s:WindowedApplication>
package flexUnitTests
{
import flexunit.framework.Assert;
public class HelloworldFlexTest
{
var obj:HelloworldFlex;
[Before]
public function setUp():void
{
this.obj = new HelloworldFlex;
}
[After]
public function tearDown():void
{
}
[BeforeClass]
public static function setUpBeforeClass():void
{
}
[AfterClass]
public static function tearDownAfterClass():void
{
}
[Test]
public function testClickButton():void
{
var result:Boolean;
result = this.obj.clickButton();
Assert.assertEquals(true, result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment