Advertisement
techno-

ReboteTest

Nov 4th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. package e2;
  2.  
  3. import org.junit.jupiter.api.Test;
  4.  
  5. import java.util.ArrayList;
  6. import java.util.Arrays;
  7. import java.util.List;
  8.  
  9. import static org.junit.jupiter.api.Assertions.*;
  10.  
  11. class ReboteTest {
  12.  
  13.     List<String> lista = new ArrayList<String>(Arrays.asList("1","2","3","4","5"));
  14.     //Circular
  15.  
  16.     Rebote reb = new Rebote(lista,3);
  17.  
  18.  
  19.  
  20.     @Test
  21.     void hasNext() {
  22.         assertTrue(reb.hasNext());
  23.         reb.remove();
  24.         reb.remove();
  25.         reb.remove();
  26.         reb.remove();
  27.         assertFalse(reb.hasNext());
  28.     }
  29.  
  30.     @Test
  31.     void next() {
  32.         assertEquals("3",reb.next());
  33.         reb.remove();
  34.         assertEquals("4",reb.next());
  35.         reb.remove();
  36.         assertEquals("2",reb.next());
  37.         reb.remove();
  38.         assertEquals("5",reb.next());
  39.     }
  40.  
  41.     @Test
  42.     void remove() {
  43.         reb.remove();
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement