예제 #1
0
        public void getRearTest()
        {
            SeqQueue <string> seqQueue = new SeqQueue <string>(10);

            seqQueue.enter("A");
            seqQueue.enter("B");
            seqQueue.enter("C");
            seqQueue.enter("D");
            Assert.AreEqual(seqQueue.getRear(), "D");
        }
예제 #2
0
        public void exitTest()
        {
            SeqQueue <string> seqQueue = new SeqQueue <string>(10);

            seqQueue.enter("A");
            seqQueue.enter("B");
            seqQueue.enter("C");
            seqQueue.enter("D");
            seqQueue.enter("F");
            Assert.AreEqual(seqQueue.exit(), "A");
        }
예제 #3
0
        public void clearTest()
        {
            SeqQueue <string> seqQueue = new SeqQueue <string>(10);

            seqQueue.enter("A");
            seqQueue.enter("B");
            seqQueue.enter("C");
            seqQueue.enter("D");
            seqQueue.clear();
            Assert.AreEqual(seqQueue.isEmpty, true);
        }
예제 #4
0
        public void enterTest()
        {
            SeqQueue <string> seqQueue = new SeqQueue <string>(10);

            seqQueue.enter("A");
            seqQueue.enter("B");
            seqQueue.enter("C");
            seqQueue.enter("D");
            seqQueue.enter("E");
            List <string> result = new List <string>()
            {
                "A", "B", "C", "D", "E"
            };

            CollectionAssert.AreEqual(seqQueue.display(), result);
        }