Mercurial > hg > audiodb
annotate bindings/as3/ext/asunit/framework/TestMethod.as @ 770:c54bc2ffbf92 tip
update tags
author | convert-repo |
---|---|
date | Fri, 16 Dec 2011 11:34:01 +0000 |
parents | 3a0b9700b3d2 |
children |
rev | line source |
---|---|
mas01mj@732 | 1 package asunit.framework { |
mas01mj@732 | 2 |
mas01mj@732 | 3 import flash.utils.getTimer; |
mas01mj@732 | 4 |
mas01mj@732 | 5 /** |
mas01mj@732 | 6 * A <code>TestFailure</code> collects a failed test together with |
mas01mj@732 | 7 * the caught exception. |
mas01mj@732 | 8 * @see TestResult |
mas01mj@732 | 9 */ |
mas01mj@732 | 10 public class TestMethod { |
mas01mj@732 | 11 protected var test:Test; |
mas01mj@732 | 12 protected var method:String; |
mas01mj@732 | 13 |
mas01mj@732 | 14 private var _duration:Number; |
mas01mj@732 | 15 private var start:Number; |
mas01mj@732 | 16 |
mas01mj@732 | 17 /** |
mas01mj@732 | 18 * Constructs a TestMethod with a given Test and method name. |
mas01mj@732 | 19 */ |
mas01mj@732 | 20 public function TestMethod(test:Test, method:String) { |
mas01mj@732 | 21 this.test = test; |
mas01mj@732 | 22 this.method = method; |
mas01mj@732 | 23 start = getTimer(); |
mas01mj@732 | 24 } |
mas01mj@732 | 25 |
mas01mj@732 | 26 public function getName():String { |
mas01mj@732 | 27 return method; |
mas01mj@732 | 28 } |
mas01mj@732 | 29 |
mas01mj@732 | 30 public function endTest(test:Test):void { |
mas01mj@732 | 31 _duration = (getTimer() - start) * .001; |
mas01mj@732 | 32 } |
mas01mj@732 | 33 |
mas01mj@732 | 34 public function duration():Number { |
mas01mj@732 | 35 return _duration; |
mas01mj@732 | 36 } |
mas01mj@732 | 37 } |
mas01mj@732 | 38 } |