Sha256: 3f7dd9e9e9133957e3672dc658101169f022c22e3b7223596d3c7c4eaa5ba034

Contents?: true

Size: 1.78 KB

Versions: 3

Compression:

Stored size: 1.78 KB

Contents

package asunit.framework {

	import asunit.framework.TestCase;

	import asunit.support.FailAssertEquals;
	import asunit.support.FailAssertTrue;
	import asunit.support.SucceedAssertTrue;
	import asunit.support.SuiteOfTwoSuites;

	public class NestedSuiteIteratorTest extends TestCase {
		private var iterator:SuiteIterator;
		private var suiteClass:Class;
		
		public function NestedSuiteIteratorTest(testMethod:String = null) {
			super(testMethod);
		}

		protected override function setUp():void {
			suiteClass = SuiteOfTwoSuites;
		}

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

		public function test_length_from_SuiteIterator():void {
            var iterator:SuiteIterator = new SuiteIterator(suiteClass);
			assertEquals(3, iterator.length);
		}

		public function test_isSuite_false_with_test_class():void {
            var iterator:SuiteIterator = new SuiteIterator(SucceedAssertTrue);
			assertEquals(1, iterator.length);
		}
		
		public function test_getTestClasses_of_suite_class():void {
            var iterator:SuiteIterator = new SuiteIterator(suiteClass);
			assertEquals(3, iterator.length);
            assertSame(FailAssertEquals, iterator.next());
            assertSame(FailAssertTrue, iterator.next());
            assertSame(SucceedAssertTrue, iterator.next());
		}
		
		public function test_iterator_for_suite_class_with_2_nested_suites_hasNext():void {
			iterator = new SuiteIterator(suiteClass);
			assertTrue(iterator.hasNext());
		}
		
		public function test_iterator_next():void {
			iterator = new SuiteIterator(suiteClass);
			
			assertSame(FailAssertEquals,	iterator.next());
			assertSame(FailAssertTrue, 		iterator.next());
			assertSame(SucceedAssertTrue,	iterator.next());
			
			assertFalse('no methods left in iterator', iterator.hasNext());
		}
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

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