예제 #1
0
 private void PushTest(ISetOfStacks <int> setOfStacks)
 {
     for (int i = 0; i < _size; i++)
     {
         setOfStacks.Push(i);
         Assert.AreEqual(i, setOfStacks.Peek());
     }
 }
예제 #2
0
 private void PopTest(ISetOfStacks <int> setOfStacks)
 {
     for (int i = 0; i < _size; i++)
     {
         int peek = setOfStacks.Peek();
         int item = setOfStacks.Pop();
         Assert.AreEqual(peek, item);
     }
 }
예제 #3
0
 private void RunTests(ISetOfStacks <int> setOfStacks)
 {
     PushTest(setOfStacks);
     PopTest(setOfStacks);
 }