view 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
line wrap: on
line source
package asunit.framework {
    
    import flash.utils.getTimer;
    
    /**
     * A <code>TestFailure</code> collects a failed test together with
     * the caught exception.
     * @see TestResult
     */
    public class TestMethod {
        protected var test:Test;
        protected var method:String;
        
        private var _duration:Number;
        private var start:Number;
        
        /**
         * Constructs a TestMethod with a given Test and method name.
         */
        public function TestMethod(test:Test, method:String) {
            this.test = test;
            this.method = method;
            start = getTimer();
        }
        
        public function getName():String {
            return method;
        }
        
        public function endTest(test:Test):void {
            _duration = (getTimer() - start) * .001;
        }
        
        public function duration():Number {
            return _duration;
        }
    }
}