Exemplo n.º 1
0
        public void TestboolMethod()
        {
            bool actualresult = true;
            bool expectedresult;

            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            expectedresult = obj.empty();
            Assert.AreEqual(expectedresult, actualresult);
        }
Exemplo n.º 2
0
        public void TestTopMethod()
        {
            int actualresult = 10;
            int expectedresult;

            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            expectedresult = obj.top();
            Assert.AreEqual(expectedresult, actualresult);
        }
Exemplo n.º 3
0
        public void poptestmethod1()
        {
            string strexpected;
            string stractualresult = "Error in push-stack is empty";
            int    top_index       = -1;

            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            strexpected = obj.pop(top_index);
            Assert.AreEqual(strexpected, stractualresult);
        }
Exemplo n.º 4
0
        public void poptestmethod2()
        {
            string strexpected;
            string stractualresult;
            int    top_index = 2;

            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            strexpected     = obj.pop(top_index);
            stractualresult = Convert.ToString(--top_index);
            Assert.AreEqual(strexpected, stractualresult);
        }
Exemplo n.º 5
0
        public void TestMethod1()
        {
            string strexpected;
            string actualresult = "Error in push-stack is full";
            int    number       = -1;
            int    topindex     = -1;
            int    maxlen       = -1;

            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            strexpected = obj.push(number, topindex, maxlen);
            Assert.AreEqual(strexpected, actualresult);
        }
Exemplo n.º 6
0
        public void TestMethod2()
        {
            string strexpected;
            string actualresult;

            int[] stack_ref = new int[100];
            int   number    = 2;
            int   topindex  = -1;
            int   maxlen    = 99;

            //stack_ref[++topindex] = number;

            //strexpected = stack_ref[++topindex];
            C565Appln_Testcases.Class1 obj = new C565Appln_Testcases.Class1();
            strexpected  = obj.push(number, topindex, maxlen);
            actualresult = Convert.ToString(++topindex);
            Assert.AreEqual(strexpected, actualresult);
        }