Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package e2;
- import org.junit.jupiter.api.Test;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import static org.junit.jupiter.api.Assertions.*;
- class ReboteTest {
- List<String> lista = new ArrayList<String>(Arrays.asList("1","2","3","4","5"));
- //Circular
- Rebote reb = new Rebote(lista,3);
- @Test
- void hasNext() {
- assertTrue(reb.hasNext());
- reb.remove();
- reb.remove();
- reb.remove();
- reb.remove();
- assertFalse(reb.hasNext());
- }
- @Test
- void next() {
- assertEquals("3",reb.next());
- reb.remove();
- assertEquals("4",reb.next());
- reb.remove();
- assertEquals("2",reb.next());
- reb.remove();
- assertEquals("5",reb.next());
- }
- @Test
- void remove() {
- reb.remove();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement