Sha256: a4b99ba20875dafdd913f32be731bd10cee19e24badc610697701c9e97be1413

Contents?: true

Size: 1.46 KB

Versions: 28

Compression:

Stored size: 1.46 KB

Contents

import asunit.util.ArrayIterator;
import asunit.framework.TestCase;

class asunit.util.ArrayIteratorTest extends TestCase {
	private var className:String = "asunit.util.ArrayIteratorTest";
	private var instance:ArrayIterator;

	public function ArrayIteratorTest(testMethod:String) {
		super(testMethod);
	}

	public function setUp():Void {
		var arr:Array = new Array("one", "two", "three", "four", "five");
		instance = new ArrayIterator(arr);
	}

	public function tearDown():Void {
		delete instance;
	}

	public function testInstantiated():Void {
		assertTrue("ArrayIterator instantiated", instance instanceof ArrayIterator);
	}

	public function testIterate():Void {
		assertTrue("1", instance.hasNext());
		assertEquals("2", "one", instance.next());
		assertTrue("3", instance.hasNext());
		assertEquals("4", "two", instance.next());
		assertTrue("5", instance.hasNext());
		assertEquals("6", "three", instance.next());
		assertTrue("7", instance.hasNext());
		assertEquals("8", "four", instance.next());
		assertTrue("9", instance.hasNext());
		assertEquals("10", "five", instance.next());
		assertFalse("11", instance.hasNext());
	}
	
	public function testEmpty():Void {
		var itr:ArrayIterator = new ArrayIterator(new Array());
		assertFalse("1", itr.hasNext());
	}
	
	public function testSingleItem():Void {
		var itr:ArrayIterator = new ArrayIterator(new Array("one"));
		assertTrue(itr.hasNext());
		assertEquals("2", "one", itr.next());
		assertFalse("3", itr.hasNext());
		
	}
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
asproject-0.1.21 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.27 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.29 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.30 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.31 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.28 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.32 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.33 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.34 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.35 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.36 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.37 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.43 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.41 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.42 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.38 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.40 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.44 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.68 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as
asproject-0.1.60 templates/asproject/asunit25/project/lib/asunit/asunit/util/ArrayIteratorTest.as