コード例 #1
0
        public void getTopTest()
        {
            SeqStack <string> seqStack = new SeqStack <string>(10);

            seqStack.push("A");
            seqStack.push("B");
            seqStack.push("C");
            Assert.AreEqual(seqStack.getTop(), "C");
        }
コード例 #2
0
        public void clearTest()
        {
            SeqStack <string> seqStack = new SeqStack <string>(10);

            seqStack.push("A");
            seqStack.push("B");
            seqStack.push("C");
            seqStack.clear();
            Assert.AreEqual(seqStack.isEmpty, true);
        }
コード例 #3
0
        public void pushTest()
        {
            SeqStack <string> seqStack = new SeqStack <string>(10);

            seqStack.push("A");
            seqStack.push("B");
            seqStack.push("C");
            List <string> result = new List <string>()
            {
                "C", "B", "A"
            };

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