Skip to content
Snippets Groups Projects
Commit 8f60b2ed authored by Javier Calvo's avatar Javier Calvo
Browse files

PuertoTest

parent 46b3e14a
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,11 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="uses"/>
<classpathentry kind="lib" path="clases"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -165,4 +165,7 @@ public class Contenedor {
return this.pesoTara*2.20462f;
}
//AÑADIR METODO PARA AÑADIR TRAYECTOS
}
\ No newline at end of file
......@@ -10,7 +10,6 @@ import es.uva.inf.poo.maps.GPSCoordinate;
* @author javcalv
* @author victorm
*/
public class Muelle {
private Plaza[] plazas;
private String identificador;
......
/**
* Copyright Universidad de Valladolid 2024/2025
*/
package es.markse;
import static org.junit.Assert.*;
import org.junit.Test;
import es.uva.inf.poo.maps.GPSCoordinate;
/**
* Test realizados para la clase Puerto
* @author javcalv
* @author victorm
*/
public class PuertoTest {
@Test(expected = IllegalArgumentException.class)
public void testCreacionPuertoInvalida() {
Puerto p = new Puerto("ES", "455");
}
@Test
public void testPuerto() {
Puerto p = new Puerto("ES","BAR");
}
@Test
public void testAnyadirMuelle() {
Puerto p = new Puerto("ES","BAR");
GPSCoordinate cord = new GPSCoordinate(5d, 10d);
Muelle m = new Muelle("03", cord, true, 40, 5);
assertTrue(p.anyadirMuelle(m));
}
@Test
public void testAnyadirMuelleConMismoIDoMismaCoordenada() {
Puerto p = new Puerto("ES","BAR");
GPSCoordinate cord1 = new GPSCoordinate(5d, 10d);
GPSCoordinate cord2 = new GPSCoordinate(20d, -10d);
Muelle m = new Muelle("03", cord1, true, 40, 5);
p.anyadirMuelle(m);
Muelle mismoID = new Muelle("03", cord2, true, 40, 5);
Muelle mismaCoordenada = new Muelle("05", cord1, true, 40, 5);
assertFalse(p.anyadirMuelle(mismaCoordenada));
assertFalse(p.anyadirMuelle(mismoID));
}
@Test
public void testEliminarMuelle() {
fail("Not yet implemented"); // TODO
}
@Test
public void testMuellesOperativos() {
fail("Not yet implemented"); // TODO
}
@Test
public void testMuellesConEspacio() {
fail("Not yet implemented"); // TODO
}
@Test
public void testMuellesCercanoAPunto() {
fail("Not yet implemented"); // TODO
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment