public void MultiplePushTestErrorIndexOutOfRangeException() { var x = new CStack(4); x.Push(10); Assert.AreEqual(10, x.Top()); Assert.AreEqual(1, x.Size); x.Push(20); Assert.AreEqual(20, x.Top()); Assert.AreEqual(2, x.Size); x.Push(30); Assert.AreEqual(30, x.Top()); Assert.AreEqual(3, x.Size); x.Push(40); Assert.AreEqual(40, x.Top()); Assert.AreEqual(4, x.Size); x.Push(50); }
public void MultiplePushTestSuccess() { var x = new CStack(5); x.Push(10); Assert.AreEqual(10, x.Top()); Assert.AreEqual(1, x.Size); x.Push(20); Assert.AreEqual(20, x.Top()); Assert.AreEqual(2, x.Size); x.Push(30); Assert.AreEqual(30, x.Top()); Assert.AreEqual(3, x.Size); x.Push(40); Assert.AreEqual(40, x.Top()); Assert.AreEqual(4, x.Size); x.Push(-50); Assert.AreEqual(-50, x.Top()); Assert.AreEqual(5, x.Size); }
public void TopTestSuccess() { var s = new CStack(10); s.Push(19); Assert.AreEqual(19, s.Top()); Assert.AreEqual(1, s.Size); }
public void TopTestErrorInvalidOperationException() { var s = new CStack(10); s.Top(); }