From b4b885d3bc63525fa58b8eedbd0495a1e357e443 Mon Sep 17 00:00:00 2001 From: javalizard <> Date: Sun, 3 Oct 2010 18:23:09 +0000 Subject: #247 Finalized the TPriorityList class, its unit tests, and added one missing unit test to TList. --- tests/unit/Collections/TListTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/unit/Collections/TListTest.php') 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)); -- cgit v1.2.3