示例#1
0
 public void TestPush()
 {
     Pila a = new Pila();
     a.push(1);
     a.push(2);
     bool expected=false;
     if (a.tamaño() == 2 && (int)a.miembros[0] == 2) expected = true;
     Assert.IsTrue(expected);
 }
示例#2
0
 public void TestPop()
 {
     Pila a = new Pila();
     int x = 0;
     for (x=0; x < 10; x++) a.push(x);
     a.pop();
     bool expected = true;
     if ((int)a.miembros[0]==x)  expected=false;
     Assert.AreEqual(true,expected);
 }
示例#3
0
        static void Main(string[] args)
        {
            Pila a = new Pila();
            a.push(1);
            a.push(3);
            a.push(5);/*
               // a.push(7);
            //a.push(9);*/
               /* a.espejo(a);
            Console.WriteLine("Pila Actual \n");
            Console.Read();
            */
            a.contenidoPila();

            Console.Read();
            Console.WriteLine(a.pop());
            Console.WriteLine(a.pop());
            Console.WriteLine(a.pop());
            a.contenidoPila();
            Console.Read();
        }
示例#4
0
 public void TestEsVaciaNulos()
 {
     Pila a = new Pila(8);
     Assert.IsTrue(a.esVacia());
 }