public void TestPeekEmptyQueue() { // ARRANGE QueueLab.queue myQueue = new QueueLab.queue(1); // ACT // ASSERT Assert.Throws <QueueLab.queueEmptyException>(() => myQueue.peek()); }
public void TestPeek() { // ARRANGE QueueLab.queue myQueue = new QueueLab.queue(1); String item = "queueItem"; String actual, expected; expected = item; // ACT myQueue.enqueue(item); actual = myQueue.peek(); // ASSERT Assert.Equal(expected, actual); }
static void Main(string[] args) { QueueLab.queue myQueue = new QueueLab.queue(2); String item = "queueItem"; String actual, expected; expected = "queueItem3"; myQueue.enqueue(item + "1"); myQueue.enqueue(item + "2"); myQueue.dequeue(); myQueue.enqueue(item + "3"); myQueue.dequeue(); actual = myQueue.peek(); }
public void TestEnqueue() { // ARRANGE QueueLab.queue myQueue = new QueueLab.queue(2); String item = "queueItem"; String actual, expected; expected = "queueItem1"; // ACT myQueue.enqueue(item + "1"); myQueue.enqueue(item + "2"); actual = myQueue.peek(); // ASSERT Assert.Equal(expected, actual); }