Mercurial > hg > audiodb
comparison bindings/as3/ext/asunit/framework/TestMethod.as @ 732:3a0b9700b3d2
* Initial AS3 commit
author | mas01mj |
---|---|
date | Tue, 14 Sep 2010 16:47:10 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
731:65134dd772fc | 732:3a0b9700b3d2 |
---|---|
1 package asunit.framework { | |
2 | |
3 import flash.utils.getTimer; | |
4 | |
5 /** | |
6 * A <code>TestFailure</code> collects a failed test together with | |
7 * the caught exception. | |
8 * @see TestResult | |
9 */ | |
10 public class TestMethod { | |
11 protected var test:Test; | |
12 protected var method:String; | |
13 | |
14 private var _duration:Number; | |
15 private var start:Number; | |
16 | |
17 /** | |
18 * Constructs a TestMethod with a given Test and method name. | |
19 */ | |
20 public function TestMethod(test:Test, method:String) { | |
21 this.test = test; | |
22 this.method = method; | |
23 start = getTimer(); | |
24 } | |
25 | |
26 public function getName():String { | |
27 return method; | |
28 } | |
29 | |
30 public function endTest(test:Test):void { | |
31 _duration = (getTimer() - start) * .001; | |
32 } | |
33 | |
34 public function duration():Number { | |
35 return _duration; | |
36 } | |
37 } | |
38 } |