コード例 #1
0
        public void CircularQueueEmptyandGetCount()
        {
            int maxSize = 100;
            var myQueue = new MyCircularQueue(maxSize);

            Assert.AreEqual(0, myQueue.GetCount());
        }
コード例 #2
0
        public void CircularQueuePushGetCount()
        {
            int maxSize = 100;
            var myQueue = new MyCircularQueue(maxSize);

            myQueue.Push(1);

            Assert.AreEqual(1, myQueue.GetCount());
        }
コード例 #3
0
        public void CircularQueuePush3ItemAndPopGetCount()
        {
            int maxSize = 100;
            var myQueue = new MyCircularQueue(maxSize);

            myQueue.Push(1);
            myQueue.Push("1");
            myQueue.Push("A");
            var obj = myQueue.Pop();

            Assert.AreEqual(1, obj);
            Assert.AreEqual(2, myQueue.GetCount());
        }