public void ERROR2() { MyStack <string> stack = new MyStack <string>(); stack.Push("l"); stack.Push("o"); stack.Pop(); stack.Pop(); stack.Pop(); }
public void ERROR1() { MyStack <string> stack = new MyStack <string>(); stack.Push("p"); stack.Push("o"); stack.Pop(); stack.Pop(); stack.Peek(); }
public void Peek_PushTwoItemsAndPop_ReturnsHeadElement() { var stack = new MyStack <int>(); stack.Push(1); stack.Push(2); stack.Pop(); Assert.AreEqual(1, stack.Peek()); }
public void popeek() { MyStack <string> stack = new MyStack <string>(); stack.Push("6"); stack.Push("7"); stack.Pop(); string expected = "6"; Assert.AreEqual(expected, stack.Peek()); }
public void Pop_EmptyStack_ThrowsException() { var stack = new MyStack <int>(); Assert.Throws <InvalidOperationException>(() => { stack.Pop(); }); }