Sha256: 4f9a3d5bb146a5a2401f74b9955c28ce2f905510571e4e580ed54567e5aae091

Contents?: true

Size: 1.73 KB

Versions: 3

Compression:

Stored size: 1.73 KB

Contents

package asunit.framework {

	import asunit.framework.TestCase;
    import asunit.util.Iterator;

	import asunit.support.OrderedTestMethod;

	public class TestIteratorOrderedTestMethodTest extends TestCase {

		private var iterator:Iterator;
		private var orderedTest:OrderedTestMethod;

		public function TestIteratorOrderedTestMethodTest(testMethod:String = null) {
			super(testMethod);
		}

		protected override function setUp():void {
            super.setUp();
			orderedTest = new OrderedTestMethod();
		}

		protected override function tearDown():void {
            super.tearDown();
			iterator    = null;
			orderedTest = null;
		}

		public function test_countTestMethods_of_test():void {
            iterator = new TestIterator(orderedTest);
			assertEquals(4, iterator.length);
		}
		
		public function test_get_test_methods_of_test_instance():void {
			//NOTE: Avoid naming variables the same as testMethods property in asunit.framework.TestCase.
            var iterator:Iterator = new TestIterator(orderedTest);
			
			assertEquals(4, iterator.length);
            var first:Method = iterator.next();
            var second:Method = iterator.next();
            var third:Method = iterator.next();
            var fourth:Method = iterator.next();

            assertFalse("Should be out of items", iterator.next());

			assertEquals(first.name,  'negativeOrderIsAllowed');
			assertEquals(second.name, 'zeroIsDefaultOrder');
			assertEquals(third.name,  'two');
			assertEquals(fourth.name, 'three');
			
			assertEquals(orderedTest.negativeOrderIsAllowed, 	first.value);
			assertEquals(orderedTest.zeroIsDefaultOrder,		second.value);
			assertEquals(orderedTest.two, 						third.value);
			assertEquals(orderedTest.three, 					fourth.value);
		}
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
asunit4-4.2.3.pre test/asunit/framework/TestIteratorOrderedTestMethodTest.as
asunit4-4.2.2.pre test/asunit/framework/TestIteratorOrderedTestMethodTest.as
asunit4-4.2.1.pre test/asunit/framework/TestIteratorOrderedTestMethodTest.as