public static void test_pop_exception() { GenericStack <int> stackOfInts = new GenericStack <int>(2); int nr = stackOfInts.Pop(); Console.WriteLine(stackOfInts.ToString()); }
public static void test_push_pop() { GenericStack <int> stackOfInts = new GenericStack <int>(4); stackOfInts.Push(1); stackOfInts.Push(2); stackOfInts.Push(3); Console.WriteLine("Stack:"); Console.WriteLine(stackOfInts.ToString()); int nrPop = stackOfInts.Pop(); Console.WriteLine("Popped Stack"); Console.WriteLine(stackOfInts.ToString()); Console.WriteLine($"popped number: {nrPop}"); }