Пример #1
0
 /** Simple test to show that size() is working correctly as items are being pushed/popped. */
 @Ignore
 @Test
 public void testPushPopSize() {
   final StackIF<String> stack = makeStringStack();
   stack.push(values[0]);
   stack.push(values[1]);
   stack.push(values[1]);
   assertEquals("Stack should have a size of 3", stack.size(), 3);
   stack.pop();
   stack.push(values[2]);
   stack.push(values[1]);
   stack.push(values[0]);
   assertEquals("Stack should have a size of 5", stack.size(), 5);
   stack.pop();
   stack.pop();
   stack.pop();
   stack.pop();
   stack.pop();
   assertEquals("Stack should be empty", stack.size(), 0);
 }
Пример #2
0
 /** Tests that a stack is empty when it's initially created. */
 @Ignore
 @Test
 public void isNewStackEmpty() {
   final StackIF<Integer> stack = makeIntegerStack();
   assertEquals("Empty stack should have size 0", 0, stack.size());
 }