summaryrefslogtreecommitdiff
path: root/tests/unit/Collections/TListTest.php
diff options
context:
space:
mode:
authorjavalizard <>2010-10-03 18:23:09 +0000
committerjavalizard <>2010-10-03 18:23:09 +0000
commitb4b885d3bc63525fa58b8eedbd0495a1e357e443 (patch)
tree8f8ba71dc43d6969698cc01fae70f52926f9daf4 /tests/unit/Collections/TListTest.php
parent72f08f29e60e0218abbd12051119ab196cd59b23 (diff)
#247 Finalized the TPriorityList class, its unit tests, and added one missing unit test to TList.
Diffstat (limited to 'tests/unit/Collections/TListTest.php')
-rw-r--r--tests/unit/Collections/TListTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/Collections/TListTest.php b/tests/unit/Collections/TListTest.php
index a97273dc..a5a1b2b0 100644
--- a/tests/unit/Collections/TListTest.php
+++ b/tests/unit/Collections/TListTest.php
@@ -51,6 +51,16 @@ class TListTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(2,$this->list->Count);
}
+ public function testItemAt() {
+ $this->assertTrue($this->list->itemAt(0) === $this->item1);
+ $this->assertTrue($this->list->itemAt(1) === $this->item2);
+ try {
+ $this->list->itemAt(2);
+ $this->fail('exception not raised when adding item at an out-of-range index');
+ } catch(TInvalidDataValueException $e) {
+ }
+ }
+
public function testAdd() {
$this->assertEquals(2,$this->list->add(null));
$this->assertEquals(3,$this->list->add($this->item3));