package net.franckbenault.testcollection.vector;

import static org.junit.Assert.*;

import java.util.Vector;

import org.junit.Test;

public class VectorTestCase {
	
	@Test
	public void testCreation() {
		
		//init capacity = 3
		//then add the capacity by 3
		Vector<String> v = new Vector<String>(3);
		assertEquals(v.capacity(),3);
		
		v.add("one");
		v.add("two");
		assertEquals(v.capacity(),3);
		
		v.add("three");
		v.add("four");
		assertEquals(v.capacity(),6);
		
	}

	@Test
	public void testCreation2() {
		
		//init capacity = 3
		//then add the capacity by 2
		Vector<String> v = new Vector<String>(3, 2);
		assertEquals(v.capacity(),3);
		
		v.add("one");
		v.add("two");
		assertEquals(v.capacity(),3);
		
		v.add("three");
		v.add("four");
		assertEquals(v.capacity(),5);
	}
	
	@Test
	public void testLoop() {
		

		Vector<String> v = new Vector<String>(3, 2);
		v.add("one");
		v.add("two");
		v.add("three");
		v.add("four");

		for(String s : v) {
			System.out.println(s);
		}
		
	}
}

@@ -176,32 +176,34 @@
 public void test
+01
 Creation() %7B%0A%09%09%0A
@@ -471,16 +471,90 @@
 ,6);%0A%09%09%0A
+%09%09v.remove(%22four%22);%0A%09%09v.remove(%22one%22);%0A%09%09assertEquals(v.capacity(),6);%0A%09%09%0A
 %09%7D%0A%0A%09@Te
@@ -573,24 +573,26 @@
 oid test
+02
 Creation
 2() %7B%0A%09%09
@@ -583,17 +583,16 @@
 Creation
-2
 () %7B%0A%09%09%0A
@@ -889,16 +889,18 @@
 oid test
+03
 Loop() %7B
@@ -1077,10 +1077,370 @@
 %7D%0A%09%09%0A%09%7D%0A
+%09%0A%09@Test%0A%09public void test04AddElementRemoveElement() %7B%0A%09%09%0A%09%09//addElement and RemoveElement can be changed to add and remove%0A%09%09Vector%3CString%3E v = new Vector%3CString%3E(3, 2);%0A%09%09v.addElement(%22one%22);%0A%09%09v.addElement(%22two%22);%0A%09%09v.addElement(%22three%22);%0A%09%09v.addElement(%22four%22);%0A%0A%09%09assertEquals(v.size(),4);%0A%09%09%0A%09%09v.removeElement(%22one%22);%0A%09%09assertEquals(v.size(),3);%0A%09%7D%0A%09%09%0A%0A
 %7D%0A

add vectors tests