예제 #1
0
 @Test
 public void testEmpty() {
   LinkedStackOfStrings s = new LinkedStackOfStrings();
   assertTrue(s.isEmpty());
   s.push("one");
   assertFalse(s.isEmpty());
 }
예제 #2
0
 public void testPush2() {
   LinkedStackOfStrings s = new LinkedStackOfStrings();
   s.push("one");
   s.push("two");
   s.push("three");
   assertFalse(s.isEmpty());
   assertTrue(s.pop().equals("three"));
   assertTrue(s.pop().equals("two"));
   assertTrue(s.pop().equals("one"));
   assertTrue(s.isEmpty());
 }