public void Clear_stack() { MyStack <int> stack = new MyStack <int>(); stack.Push(10); Assert.AreEqual(1, stack.Count_in_Array()); stack.Clear(); Assert.AreEqual(0, stack.Count_in_Array()); }
public void count_elem_into_stack() { MyStack <int> stack = new MyStack <int>(); int x = 10; int y = 18; int z = 50; stack.Push(x); stack.Push(y); stack.Push(z); Assert.AreEqual(3, stack.Count_in_Array()); stack.Pop(); Assert.AreEqual(2, stack.Count_in_Array()); stack.Pop(); Assert.AreEqual(1, stack.Count_in_Array()); stack.Pop(); Assert.AreEqual(0, stack.Count_in_Array()); }
public void max_int_1000_elem() { MyStack <int> stack = new MyStack <int>(); for (int i = 0; i < 1000; i++) { stack.Push(1); } Assert.AreEqual(1000, stack.Count_in_Array()); }