From 05efb2aae0a02339651ef5bdeaa195b20ef35c95 Mon Sep 17 00:00:00 2001 From: Eric Neves Date: Mon, 19 Aug 2024 10:05:30 -0400 Subject: [PATCH] Add test to assert the value of a dequeued element --- tests/DataStructures/QueueTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/DataStructures/QueueTest.php b/tests/DataStructures/QueueTest.php index 66379205..07006d4c 100644 --- a/tests/DataStructures/QueueTest.php +++ b/tests/DataStructures/QueueTest.php @@ -35,6 +35,21 @@ public function shouldRemoveElementFromQueue(): void $this->assertEquals(2, $queue->size()); } + /** + * @test + */ + public function shouldReturnCorrectValueWhenDequeue(): void + { + $queue = new Queue(); + $queue->enqueue(1); + $queue->enqueue(2); + $queue->enqueue(3); + + $this->assertEquals(1, $queue->dequeue()); + $this->assertEquals(2, $queue->dequeue()); + $this->assertEquals(3, $queue->dequeue()); + } + /** * @test */