Created
May 9, 2013 04:59
-
-
Save mia-0032/5545651 to your computer and use it in GitHub Desktop.
Adobe FlexプロジェクトでHelloWorldとUnitTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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