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); }
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); }
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(); }
public void TestEsVaciaNulos() { Pila a = new Pila(8); Assert.IsTrue(a.esVacia()); }