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); } } }
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); } } }