test/asunit/runners/TestRunnerAsyncMethodTest.as in asunit4-4.2.2.pre vs test/asunit/runners/TestRunnerAsyncMethodTest.as in asunit4-4.2.3.pre
- old
+ new
@@ -1,9 +1,8 @@
package asunit.runners {
import asunit.asserts.*;
- import asunit.framework.CallbackBridge;
import asunit.framework.TestCase;
import asunit.util.Iterator;
import asunit.framework.IAsync;
import asunit.framework.Method;
@@ -16,14 +15,17 @@
public class TestRunnerAsyncMethodTest {
[Inject]
public var async:IAsync;
+ private var runner:TestRunner;
+
+ [Before]
+ public function before():void {
+ runner = new TestRunner();
+ }
- [Inject]
- public var runner:TestRunner;
-
[Test]
public function asyncShouldWork():void {
runner.addEventListener(Event.COMPLETE, async.add(ensureRunnerHasNotYetFailed, 100));
runner.run(AsyncMethodSuccessTest);
}
@@ -33,21 +35,21 @@
runner.addEventListener(Event.COMPLETE, async.add(ensureRunnerHasNotYetFailed, 10));
runner.run(AsyncDelegateCalledSynchronouslyTest);
}
private function ensureRunnerHasNotYetFailed(e:Event):void {
- assertFalse('runner result has not failed', runner.bridge.failureEncountered);
+ assertFalse('runner result has not failed', runner.result.failureEncountered);
}
[Test]
public function shouldSeeErrorWhenAsyncFailure():void {
runner.addEventListener(Event.COMPLETE, async.add(checkResultForIllegalOperationError, 200));
runner.run(AsyncMethodTooSlowTest);
}
private function checkResultForIllegalOperationError(e:Event):void {
- assertEquals('number of errors', 1, runner.bridge.errors.length);
- var failure0:TestFailure = runner.bridge.errors[0] as TestFailure;
+ assertEquals('number of errors', 1, runner.result.errors.length);
+ var failure0:TestFailure = runner.result.errors[0] as TestFailure;
assertEquals('exception type', 'flash.errors::IllegalOperationError', getQualifiedClassName(failure0.thrownException));
assertEquals('failed method name', 'shouldFailForBeingTooSlow', failure0.failedMethod);
}
}
}