public void Dequeue_QueueContainsSeveralElements_DeletesReturnedElement() { // // Arrange. // bool expectedResult = false; bool actualResult = false; string firstElement = "First"; QueueThroughLinkedList <string> queue = new QueueThroughLinkedList <string>(); queue.Enqueue(firstElement); queue.Enqueue("Second"); queue.Enqueue("Third"); // // Act. // queue.Dequeue(); string[] arrayOfLeftItems = new string[] { queue.Dequeue(), queue.Dequeue() }; actualResult = arrayOfLeftItems.Contains(firstElement); // // Assert. // Assert.AreEqual(expectedResult, actualResult); }
public void Dequeue_QueueIsEmpty_ThrowsInvalidOperationException() { // // Arrange. // QueueThroughLinkedList <string> queue = new QueueThroughLinkedList <string>(); // // Act. // queue.Dequeue(); }
public void Dequeue_QueueContainsSeveralElements_ReturnsFirstElement() { // // Arrange. // string expectedResult = "First"; string actualResult = string.Empty; QueueThroughLinkedList <string> queue = new QueueThroughLinkedList <string>(); queue.Enqueue(expectedResult); queue.Enqueue("Second"); queue.Enqueue("Third"); // // Act. // actualResult = queue.Dequeue(); // // Assert. // Assert.AreEqual(expectedResult, actualResult); }