Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package datastructures;
- import static org.junit.Assert.*;
- import org.junit.Before;
- import org.junit.Test;
- public class MyQueueTest {
- @Before
- public void setUp() throws Exception {
- }
- @Test
- public void testAdd() {
- IList<Integer> list = new Queue<Integer>();
- list.add(1);
- list.add(2);
- list.add(3);
- list.add(3);
- list.add(4);
- assertTrue(list.item() == 1);
- }
- @Test
- public void testRemove() {
- IList<Integer> list = new Queue<Integer>();
- list.add(1);
- list.add(2);
- list.add(3);
- list.add(3);
- list.add(4);
- list.remove();
- assertTrue(list.item() == 2);
- list.remove();
- list.remove();
- assertTrue(list.item() == 3);
- }
- @Test
- public void testItem() {
- IList<Integer> list = new Queue<Integer>();
- list.add(1);
- list.add(2);
- list.add(3);
- list.add(3);
- list.add(4);
- assertTrue(list.item() == 1);
- }
- @Test
- public void testIsEmpty() {
- IList<Integer> list = new Queue<Integer>();
- assertTrue(list.isEmpty() == true);
- list.add(1);
- list.add(2);
- list.add(3);
- assertTrue(list.isEmpty() == false);
- }
- }
Add Comment
Please, Sign In to add comment