Example #1
0
 public void OneValueGetMax()
 {
     IntMaxStack i = new IntMaxStack();
     i.Push(5);
     int n = i.GetMax();
     Assert.AreEqual(n, 5);
 }
Example #2
0
 public void MultValueRemoveGetMax()
 {
     IntMaxStack i = new IntMaxStack();
     i.Push(5);
     i.Push(4);
     i.Push(9);
     i.Push(12);
     i.Remove();
     int n = i.GetMax();
     Assert.AreEqual(n, 9);
 }
Example #3
0
 public void MoreRemoveThanPushGetMax()
 {
     IntMaxStack i = new IntMaxStack();
     i.Push(5);
     i.Push(4);
     i.Push(9);
     i.Push(12);
     i.Remove();
     int n = i.GetMax();
     Assert.AreEqual(n, 9);
     i.Remove();
     n = i.GetMax();
     Assert.AreEqual(n, 5);
     i.Remove();
     n = i.GetMax();
     Assert.AreEqual(n, 5);
     i.Remove();
     n = i.GetMax();
     Assert.AreEqual(n, -1);
     i.Remove();
     n = i.GetMax();
     Assert.AreEqual(n, -1);
 }
Example #4
0
 public void NoValuesGetMax()
 {
     IntMaxStack i = new IntMaxStack();
     int n = i.GetMax();
     Assert.AreEqual(n, -1);
 }