public void PopTestSuccess() { var s = new CStack(10); s.Push(11); Assert.AreEqual(1, s.Size); int popRtrn = s.Pop(); Assert.AreEqual(11, popRtrn); Assert.AreEqual(0, s.Size); }
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 PushTestSuccess() { var s = new CStack(10); s.Push(10); Assert.AreEqual(1, s.Size); }
public void PushTestErrorIndexOutOfRangeException() { var s = new CStack(0); s.Push(10); }
public void TopTestSuccess() { var s = new CStack(10); s.Push(19); Assert.AreEqual(19, s.Top()); Assert.AreEqual(1, s.Size); }