Location: A review of cardiac cellular electrophysiology models @ 98909b01e6b2 / dojo-presentation / js / dojo / dojox / collections / tests / Stack.js

Author:
David Nickerson <nickerso@users.sourceforge.net>
Date:
2009-07-07 17:11:57+12:00
Desc:
update for modified HH graphs in tutorial description
Permanent Source URI:
https://models.physiomeproject.org/workspace/a1/rawfile/98909b01e6b21653a5e1cd28865dd259c586d490/dojo-presentation/js/dojo/dojox/collections/tests/Stack.js

dojo.provide("dojox.collections.tests.Stack");
dojo.require("dojox.collections.Stack");

tests.register("dojox.collections.tests.Stack", [
	function testCtor(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		t.assertEqual(4, s.count);
	},
	function testClear(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		s.clear();
		t.assertEqual(0, s.count);
	},
	function testClone(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		var cloned=s.clone();
		t.assertEqual(s.count, cloned.count);
		t.assertEqual(s.toArray().join(), cloned.toArray().join());
	},
	function testContains(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		t.assertTrue(s.contains("bar"));
		t.assertFalse(s.contains("faz"));
	},
	function testGetIterator(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		var itr=s.getIterator();
		while(!itr.atEnd()){ itr.get(); }
		t.assertEqual("bull", itr.element);
	},
	function testPeek(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		t.assertEqual("bull", s.peek());
	},
	function testPop(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		t.assertEqual("bull", s.pop());
		t.assertEqual("test", s.pop());
	},
	function testPush(t){
		var s=new dojox.collections.Stack(["foo","bar","test","bull"]);
		s.push("bug");
		t.assertEqual("bug", s.peek());
	}
]);