示例#1
0
        public void ShouldEnqueueElement()
        {
            Data.Structures.Queue <int> queue = new Data.Structures.Queue <int>();
            Assert.IsTrue(queue.IsEmpty);
            int element = 1;

            queue.Enqueue(element);
            Assert.AreEqual(1, queue.Count);
        }
示例#2
0
        public void ShouldDequeue()
        {
            Data.Structures.Queue <int> queue = new Data.Structures.Queue <int>();
            int element = 1;

            queue.Enqueue(element);
            int removed = queue.Dequeue();

            Assert.IsTrue(queue.IsEmpty);
            Assert.AreEqual(element, removed);
        }