|
From: Robert S. <rob...@gm...> - 2007-03-31 21:54:47
|
Has anyone else had this problem?
C:\SVN\AgCg\ActionScript3\Projects\ASUnitDemo\tests\ExampleTest.as(4): col:
35 Error: The definition of base class TestCase was not found.
I am using FlashDevelop and Ant, but I know neither is my problem as I tried
to compile by hand:
C:\SVN\AgCg\ActionScript3\Projects\ASUnitDemo>mxmlc -sp="C:/Program
Files/AsUnit/framework/as3/asunit"
-sp=C:/SVN/AgCg/ActionScript3/Projects/ASUnitDemo/tests
-default-frame-rate=24 -default-background-color=0xFFFFFF -default-size 550
400 -o=C:/SVN/AgCg/ActionScript3/Projects/ASUnitDemo/deploy/App.swf --
C:/SVN/AgCg/ActionScript3/Projects/ASUnitDemo/src/App.as
My directory structure is as follows:
ASUnitDemo/
-src/
--App.as
--Example.as
-tests/
--AllTests.as
--ExampleTest.as
The contents of the relevant files are as follows:
App.as
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import ExampleTest;
public class App extends Sprite
{
public function App()
{
init();
}
private function init():void
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
var tests:ExampleTest = new ExampleTest();
}
}
}
Example.as
package {
public class Example {
public function Example() {
}
}
}
AllTests.as
package {
import asunit.framework.TestSuite;
import ExampleTest;
public class AllTests extends asunit.framework.TestSuite{
public function AllTests() {
addTest(new ExampleTest());
}
}
}
ExampleTest.as
package {
import asunit.framework.TestCase;
public class ExampleTest extends TestCase {
private var instance:Example;
public function ExampleTest(testMethod:String = null) {
super(testMethod);
}
protected override function setUp():void {
instance = new Example();
}
protected override function tearDown():void {
instance = null;
}
public function testInstantiated():void {
assertTrue("Example instantiated", instance is Example);
}
public function test():void {
assertTrue("failing test", false);
}
}
}
Thanks in advance for any help!
Robert
|