예제 #1
0
 @Test
 public void testFull() {
   stack.push("Papir");
   stack.push("Prut");
   stack.push("Hej");
   assertTrue(stack.peek().equals("Hej"));
 }
예제 #2
0
 @Test
 public void testIsClear() {
   assertTrue((stack.peek().equals("Hest")));
   stack.clear();
   assertTrue(stack.isEmpty());
   assertTrue(stack.peek() == null);
 }
예제 #3
0
 @Before
 public void setUp() {
   stack = new ListStack<>();
   stack.push("Mark");
   stack.push("Nick");
   stack.push("Hest");
 }
예제 #4
0
 @Test
 public void testIsEmptry() {
   assertFalse(stack.isEmpty());
   stack.pop();
   stack.pop();
   stack.pop();
   assertTrue(stack.isEmpty());
 }
예제 #5
0
 @Test
 public void testPop() {
   assertTrue((stack.peek().equals("Hest")));
   stack.pop();
   assertTrue((stack.peek().equals("Nick")));
 }
예제 #6
0
 @Test
 public void testTop() {
   assertTrue((stack.peek().equals("Hest")));
 }