コード例 #1
0
 private void AddStackValues <T>(IStacks <T> stacks, T[][] stackValues)
 {
     for (int i = 0; i < stackValues.Length; i++)
     {
         for (int j = 0; j < stackValues[i].Length; j++)
         {
             T   value      = stackValues[i][j];
             int stackIndex = i;
             stacks.Push(value, stackIndex);
         }
     }
 }
コード例 #2
0
 private void PushTest(IStacks <int> stacks)
 {
     int[][] stackValues = GetStackValues();
     for (int i = 0; i < stackValues.Length; i++)
     {
         for (int j = 0; j < stackValues[i].Length; j++)
         {
             int value      = stackValues[i][j];
             int stackIndex = i;
             stacks.Push(value, stackIndex);
             int result = stacks.Peek(stackIndex);
             Assert.AreEqual(value, result);
         }
     }
 }