示例#1
0
        public void TestAsserArrStack()
        {
            ArrStack <int> A = new ArrStack <int>();

            A.Push(1);
            A.Push(2);
            A.Push(3);
            A.Push(4);
            A.Push(5);

            //Pop
            //Normal
            int testnum1 = A.Pop(); //1
            int testnum2 = A.Pop(); //2

            Assert.AreEqual(5, testnum1);
            Assert.AreEqual(4, testnum2);
            //Edge
            A.Pop(); //3
            A.Pop(); //4
            A.Pop(); //5
        }
示例#2
0
        public void TestExceptionLinkStack()
        {
            ArrStack <int> A = new ArrStack <int>();

            A.Push(1);
            A.Push(2);
            A.Push(3);
            A.Push(4);
            A.Push(5);

            //Take
            int testnum1 = A.Pop(); //1-st
            int testnum2 = A.Pop(); //2-st

            A.Pop();                //3-st
            A.Pop();                //4-st
            A.Pop();                //5-st!
            A.Pop();                //Несуществующий
        }
示例#3
0
文件: Test.cs 项目: Laetar/Epam
        public void TestAsserArrStack()
        {
            ArrStack<int> A = new ArrStack<int>();

            A.Push(1);
            A.Push(2);
            A.Push(3);
            A.Push(4);
            A.Push(5);

            //Pop
            //Normal
            int testnum1 = A.Pop(); //1
            int testnum2 = A.Pop(); //2
            Assert.AreEqual(5, testnum1);
            Assert.AreEqual(4, testnum2);
            //Edge
            A.Pop(); //3
            A.Pop(); //4
            A.Pop(); //5
        }
示例#4
0
文件: Test.cs 项目: Laetar/Epam
        public void TestExceptionrArrStack()
        {
            ArrStack<int> A = new ArrStack<int>();

            A.Push(1);
            A.Push(2);
            A.Push(3);
            A.Push(4);
            A.Push(5);

            //Take
            int testnum1 = A.Pop(); //1-st
            int testnum2 = A.Pop(); //2-st
            A.Pop(); //3-st
            A.Pop(); //4-st
            A.Pop(); //5-st!
            A.Pop(); //Несуществующий
        }