mas01mj@732: package asunit.framework { mas01mj@732: mas01mj@732: import flash.utils.getTimer; mas01mj@732: mas01mj@732: /** mas01mj@732: * A TestFailure collects a failed test together with mas01mj@732: * the caught exception. mas01mj@732: * @see TestResult mas01mj@732: */ mas01mj@732: public class TestMethod { mas01mj@732: protected var test:Test; mas01mj@732: protected var method:String; mas01mj@732: mas01mj@732: private var _duration:Number; mas01mj@732: private var start:Number; mas01mj@732: mas01mj@732: /** mas01mj@732: * Constructs a TestMethod with a given Test and method name. mas01mj@732: */ mas01mj@732: public function TestMethod(test:Test, method:String) { mas01mj@732: this.test = test; mas01mj@732: this.method = method; mas01mj@732: start = getTimer(); mas01mj@732: } mas01mj@732: mas01mj@732: public function getName():String { mas01mj@732: return method; mas01mj@732: } mas01mj@732: mas01mj@732: public function endTest(test:Test):void { mas01mj@732: _duration = (getTimer() - start) * .001; mas01mj@732: } mas01mj@732: mas01mj@732: public function duration():Number { mas01mj@732: return _duration; mas01mj@732: } mas01mj@732: } mas01mj@732: }