package test;

import static org.junit.Assert.assertEquals;

import java.util.HashMap;
import java.util.Map;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import processing.core.PVector;

public class VetorCompostoTest {

  PVector local, dir, acel, testVector;
  String localLabel, dirLabel, acelLabel;
  Map<String, PVector> vectors;

  @Before
  public void setUp() throws Exception {

    vectors = new HashMap<String, PVector>();

    local = PVector.random2D();
    dir = PVector.random2D();
    acel = PVector.random2D();

    localLabel = "localLabel";
    dirLabel = "dirLabel";
    acelLabel = "acelLabel";

    vectors.put("localLabel", local);
    vectors.put("dirLabel", dir);
    vectors.put("acelLabel", acel);

    testVector = vectors.get(localLabel);

    vectors.remove(dirLabel);

  }

  @After
  public void tearDown() throws Exception {
    vectors.clear();
  }

  @Test
  public void testQuandoForAdicionadoNovoVetor() {
    assertEquals(testVector, vectors.get(localLabel));
  }

  @Test
  public void testQuandoForRemovidoPeloLabel() {
    assertEquals(vectors.get(dirLabel), null);
  }

}

@@ -107,32 +107,8 @@
 p;%0A%0A
-import org.junit.After;%0A
 impo
@@ -255,56 +255,15 @@
 test
-Vector;%0A  String localLabel, dirLabel, acelLabel
+, empty
 ;%0A  
@@ -387,25 +387,24 @@
 PVector%3E();%0A
-%0A
     local = 
@@ -402,24 +402,28 @@
  local =
+ new
  PVector
 .random2
@@ -410,34 +410,39 @@
  new PVector
-.random2D(
+(1.4e-3F, 3e-3F
 );%0A    dir =
@@ -441,24 +441,28 @@
    dir =
+ new
  PVector
 .random2
@@ -453,26 +453,29 @@
  PVector
-.random2D(
+(1e-3F, 6e-3F
 );%0A    a
@@ -479,24 +479,28 @@
   acel =
+ new
  PVector
 .random2
@@ -495,107 +495,109 @@
 ctor
-.random2D(
+(1.2e-3F, 1.2e-3F
 );%0A
-%0A
     
-localLabel = %22localLabel%22;%0A    dirLabel = %22dirLabel%22;%0A    acelLabel = %22acelLabel%22
+test = new PVector(1.4e-3F + 1e-3F, 3e-3F + 6e-3F);%0A    empty = new PVector()
 ;%0A%0A 
@@ -617,21 +617,16 @@
 t(%22local
-Label
 %22, local
@@ -649,22 +649,19 @@
 ut(%22
-dirLab
+ac
 el%22, 
-dir
+acel
 );%0A 
@@ -680,361 +680,410 @@
 ut(%22
-acelLabel%22, acel);%0A%0A    testVector = vectors.get(localLabel);%0A%0A    vectors.remove(dirLabe
+dir%22, dir);%0A%0A  %7D%0A%0A  @Test%0A  public void testQuandoForAdicionadoNovoVetor() %7B%0A    vectors.put(%22local%22, loca
 l);%0A
-%0A
   
-%7D%0A%0A  @After%0A  public void tearDown() throws Exception %7B%0A    vectors.clear();%0A  %7D%0A%0A  @Test%0A  public void testQuandoForAdicionadoNovoVetor() %7B%0A    assertEquals(testVector, vectors.get(localLabel));%0A  %7D%0A%0A  @Test%0A  public void testQuandoForRemovidoPeloLabel() %7B
+  assertEquals(local, vectors.get(%22local%22));%0A  %7D%0A%0A  @Test%0A  public void testQuandoForRemovidoPeloLabel() %7B%0A    vectors.remove(%22dir%22);%0A    assertEquals(vectors.get(%22dir%22), null);%0A  %7D%0A%0A  @Test%0A  public void testQuandoForTrabalhadoPeloNome() %7B%0A    vectors.get(%22local%22).add(vectors.get(%22dir%22));
 %0A   
@@ -1088,32 +1088,38 @@
    assertEquals(
+test, 
 vectors.get(dirL
@@ -1118,29 +1118,21 @@
 get(
-dirLabel), null
+%22local%22)
 );%0A  %7D%0A
-%0A
 %7D%0A

Add test de some de vetores