public void One() { QueueByLinkedList <int> sa = new QueueByLinkedList <int>(); sa.Enqueue(1); Assert.Equal(1, sa.Dequeue()); Assert.True(sa.IsEmpty); }
public void Bulk() { QueueByLinkedList <int> sa = new QueueByLinkedList <int>(); for (int i = 0; i < 2000000; i++) { sa.Enqueue(i); } for (int i = 0; i < 2000000; i++) { Assert.Equal(i, sa.Dequeue()); } }
public void TwoTwo() { QueueByLinkedList <int> sa = new QueueByLinkedList <int>(); sa.Enqueue(1); sa.Enqueue(2); Assert.Equal(1, sa.Dequeue()); Assert.False(sa.IsEmpty); Assert.Equal(2, sa.Dequeue()); Assert.True(sa.IsEmpty); sa.Enqueue(3); sa.Enqueue(4); Assert.Equal(3, sa.Dequeue()); Assert.False(sa.IsEmpty); Assert.Equal(4, sa.Dequeue()); Assert.True(sa.IsEmpty); }
public void None() { QueueByLinkedList <int> sa = new QueueByLinkedList <int>(); Assert.True(sa.IsEmpty); }