Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.junit.Test;
- import java.util.ArrayList;
- import java.util.List;
- import static org.junit.Assert.*;
- public class ListOfStringTest {
- // This is the Code Under Test:
- public static List<String> createListOfStringValues() {
- return new ArrayList<String>();
- }
- @Test
- public void testSomeBasics() {
- final List<String> listBeingTested = createListOfStringValues();
- assertEquals("The List should start out empty;", 0, listBeingTested.size());
- listBeingTested.add("one");
- assertEquals("After one 'add';", 1, listBeingTested.size());
- assertEquals("one", listBeingTested.get(0));
- assertEquals("one", listBeingTested.remove(0));
- assertEquals("Empty after 'remove';", 0, listBeingTested.size());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement