diff --git a/src/es/markse/Contenedor.java b/src/es/markse/Contenedor.java
index e0275ce6f1ff58072d96ce07c84d37eda706152d..1c244108f0d11ef680725d9f9f65c5f42ce4f0ef 100644
--- a/src/es/markse/Contenedor.java
+++ b/src/es/markse/Contenedor.java
@@ -243,7 +243,7 @@ public class Contenedor {
 	public boolean estadoApilado() {
 		return this.apilado;
 	}
-	
+
 	/**
 	 * Metodo que sirve para anyadir un trayecto al contenedor
 	 * @param t El trayecto que se añade al contenedor
@@ -253,16 +253,18 @@ public class Contenedor {
 	 */
 	public void anyadirTrayecto(Trayecto t) {
 		if (t == null) throw new IllegalArgumentException("El trayecto no puede ser nulo");
-		if (this.trayectos == null) this.trayectos.add(t);
+		if (this.trayectos.size() == 0) this.trayectos.add(t);
 		else {
 			Trayecto ultimoT = this.trayectos.get(this.trayectos.size() -1);
+			//Si la fecha fin es mayor a la de inicio del nuevo
 			if (ultimoT.getFechaFinTrayecto().getDiasDesdeEpoch() > t.getFechaInicioTrayecto().getDiasDesdeEpoch())
 				throw new IllegalArgumentException("La fecha fin del ultimo trayecto no puede ser mayor la fecha de inicio del siguiente");
-			if (!(ultimoT.getPuertoDestino().paisDelPuerto().equals(t.getPuertoOrigen().paisDelPuerto()) &&
-				      ultimoT.getPuertoDestino().ciudadDelPuerto().equals(t.getPuertoOrigen().ciudadDelPuerto())))
+			//Si el puerto destino no es el origen del nuevo
+			if (!ultimoT.getPuertoDestino().identificadorPuerto().equals(t.getPuertoOrigen().identificadorPuerto()))
 				throw new IllegalArgumentException("El puerto de origen debe ser el mismo que el de destino del ultimo trayecto");
-			if(!ultimoT.getMuelleDestino().equals(t.getMuelleOrigen()))
-				throw new IllegalArgumentException("El Muelle de origen es distinto al muelle de destino del ultimo trayecto");
+			//Si el muelle de destino no es el de origen del nuevo
+			if (!ultimoT.getMuelleDestino().getIdentificador().equals(t.getMuelleOrigen().getIdentificador()))
+				throw new IllegalArgumentException("El Muelle de origen debe de ser igual al de destino de su ultimo trayecto");
 			this.trayectos.add(t);
 		}
 	}
diff --git a/src/es/markse/Puerto.java b/src/es/markse/Puerto.java
index 369be2729ce3a071ac60f2cfa6f2030cc6266233..319742c20ba7ba33a3766983cb7cb50ebbbc14f5 100644
--- a/src/es/markse/Puerto.java
+++ b/src/es/markse/Puerto.java
@@ -76,7 +76,7 @@ public class Puerto {
 	 * @param m obtejo Muelle
 	 * @return true si esta, y false si no se encuentra en el puerto
 	 */
-	private boolean comprobarMuelleEnPuerto(Muelle m) {
+	public boolean comprobarMuelleEnPuerto(Muelle m) {
 	    String id = m.getIdentificador();
 	    GPSCoordinate cord = m.getGPSCoordinate();
 	    for (Muelle muelle : this.muelles) {
diff --git a/uses/es/markse/ContenedorTest.java b/uses/es/markse/ContenedorTest.java
index f99fe6aba2663820b132881422b6ca55b793a621..d49196d3c49dbcafb6ab619cbd3d2d423ce2d5b5 100644
--- a/uses/es/markse/ContenedorTest.java
+++ b/uses/es/markse/ContenedorTest.java
@@ -150,24 +150,98 @@ public class ContenedorTest {
 	
 	@Test
 	public void testAnyadirTrayecto() {
-		Contenedor c = new Contenedor("RTF", 'Z', "065432", 100, 400, 1000, false, true);
-		Puerto pOrig = new Puerto("ES" , "BAR");
-		Puerto pDestino = new Puerto("IT" , "NAP");
-		GPSCoordinate c1 = new GPSCoordinate(5d,5d);
-		GPSCoordinate c2 = new GPSCoordinate(10d,10d);
-		Muelle m1 = new Muelle("01", c1, true, 1, 1);
-		Muelle m2 = new Muelle("01", c2, true, 1, 1);
-		pOrig.anyadirMuelle(m1);
-		pDestino.anyadirMuelle(m2);
+		Contenedor c = new Contenedor("RTS", 'U', "056413", 100, 200, 1000, false, true);
 		Fecha fInicio = new Fecha (25,11,2024);
 		Fecha fFin = new Fecha(30,11,2024);
-		Trayecto t = new Trayecto(m1,pOrig,fInicio,m2,pDestino,fFin);
-		c.anyadirTrayecto(t);
-		
-		Puerto pDestino2 = new Puerto("IT" , "NAP");
-		GPSCoordinate c3 = new GPSCoordinate(11d,11d);
-		Muelle m3 = new Muelle("02", c3, true, 1, 1);
-		pDestino2.anyadirMuelle(m3);
-		
+		Muelle m1 = new Muelle("01", new GPSCoordinate(5d,5d), true, 1, 1);
+		Muelle m2 = new Muelle("01", new GPSCoordinate(10d,10d), true, 1, 1);
+		Puerto origen = new Puerto("ES" , "BAR");
+		Puerto destino = new Puerto("IT" , "NAP");
+		origen.anyadirMuelle(m1);
+		destino.anyadirMuelle(m2);
+		assertTrue(origen.comprobarMuelleEnPuerto(m1));
+		assertTrue(destino.comprobarMuelleEnPuerto(m2));
+		Trayecto t1 = new Trayecto(m1,origen,fInicio,m2,destino,fFin);
+		c.anyadirTrayecto(t1);
+		Muelle m3= new Muelle("02", new GPSCoordinate(10d,10d), true, 1, 1);
+		destino.anyadirMuelle(m3);
+		Fecha fFinal = new Fecha(1,12,2024);
+		Trayecto t2 = new Trayecto(m2,destino,fFin,m3,destino,fFinal);
+		c.anyadirTrayecto(t2);
+	}
+	
+	@Test(expected = IllegalArgumentException.class)
+	public void testAnyadirTrayectoNulo() {
+		Contenedor c = new Contenedor("RTS", 'U', "056413", 100, 200, 1000, false, true);
+		c.anyadirTrayecto(null);
+	}
+	
+	@Test(expected = IllegalArgumentException.class)
+	public void testAnyadirTrayectoFechaOrigenAntesQueFinalDeUltimoTrayecto() {
+		Contenedor c = new Contenedor("RTS", 'U', "056413", 100, 200, 1000, false, true);
+		Fecha fInicio = new Fecha (25,11,2024);
+		Fecha fFin = new Fecha(30,11,2024);
+		Muelle m1 = new Muelle("01", new GPSCoordinate(5d,5d), true, 1, 1);
+		Muelle m2 = new Muelle("01", new GPSCoordinate(10d,10d), true, 1, 1);
+		Puerto origen = new Puerto("ES" , "BAR");
+		Puerto destino = new Puerto("IT" , "NAP");
+		origen.anyadirMuelle(m1);
+		destino.anyadirMuelle(m2);
+		assertTrue(origen.comprobarMuelleEnPuerto(m1));
+		assertTrue(destino.comprobarMuelleEnPuerto(m2));
+		Trayecto t1 = new Trayecto(m1,origen,fInicio,m2,destino,fFin);
+		c.anyadirTrayecto(t1);
+		Muelle m3= new Muelle("02", new GPSCoordinate(10d,10d), true, 1, 1);
+		destino.anyadirMuelle(m3);
+		Fecha fOrigen = new Fecha(29,11,2024);
+		Fecha fFinal = new Fecha(1,12,2024);
+		Trayecto t2 = new Trayecto(m2,destino,fOrigen,m3,destino,fFinal);
+		c.anyadirTrayecto(t2);
+	}
+	
+	@Test(expected = IllegalArgumentException.class)
+	public void testAnyadirTrayectoPuertoOrigenDistintoAlPuertoDestinoAnteriro() {
+		Contenedor c = new Contenedor("RTS", 'U', "056413", 100, 200, 1000, false, true);
+		Fecha fInicio = new Fecha (25,11,2024);
+		Fecha fFin = new Fecha(30,11,2024);
+		Muelle m1 = new Muelle("01", new GPSCoordinate(5d,5d), true, 1, 1);
+		Muelle m2 = new Muelle("01", new GPSCoordinate(10d,10d), true, 1, 1);
+		Puerto origen = new Puerto("ES" , "BAR");
+		Puerto destino = new Puerto("IT" , "NAP");
+		origen.anyadirMuelle(m1);
+		destino.anyadirMuelle(m2);
+		assertTrue(origen.comprobarMuelleEnPuerto(m1));
+		assertTrue(destino.comprobarMuelleEnPuerto(m2));
+		Trayecto t1 = new Trayecto(m1,origen,fInicio,m2,destino,fFin);
+		c.anyadirTrayecto(t1);
+		Muelle m3= new Muelle("02", new GPSCoordinate(10d,10d), true, 1, 1);
+		destino.anyadirMuelle(m3);
+		Fecha fFin2 = new Fecha(4,12,2024);
+		Trayecto t2 = new Trayecto(m2,origen,fFin,m3,destino,fFin2);
+		c.anyadirTrayecto(t2);
 	}
-}
+	
+	@Test(expected = IllegalArgumentException.class)
+	public void testAnyadirTrayectoMuelleOrigenDistintoAlMuelleDestinoAnteriro() {
+		Contenedor c = new Contenedor("RTS", 'U', "056413", 100, 200, 1000, false, true);
+		Fecha fInicio = new Fecha (25,11,2024);
+		Fecha fFin = new Fecha(30,11,2024);
+		Muelle m1 = new Muelle("01", new GPSCoordinate(5d,5d), true, 1, 1);
+		Muelle m2 = new Muelle("01", new GPSCoordinate(10d,10d), true, 1, 1);
+		Puerto origen = new Puerto("ES" , "BAR");
+		Puerto destino = new Puerto("IT" , "NAP");
+		origen.anyadirMuelle(m1);
+		destino.anyadirMuelle(m2);
+		assertTrue(origen.comprobarMuelleEnPuerto(m1));
+		assertTrue(destino.comprobarMuelleEnPuerto(m2));
+		Trayecto t1 = new Trayecto(m1,origen,fInicio,m2,destino,fFin);
+		c.anyadirTrayecto(t1);
+		Muelle m3= new Muelle("02", new GPSCoordinate(11d,11d), true, 1, 1);
+		destino.anyadirMuelle(m3);
+		Muelle mNuevo= new Muelle("03", new GPSCoordinate(12d,12d), true, 1, 1);
+		destino.anyadirMuelle(mNuevo);
+		Fecha fFin2 = new Fecha(4,12,2024);
+		Trayecto t2 = new Trayecto(m3,destino,fFin,mNuevo,destino,fFin2);
+		c.anyadirTrayecto(t2);
+	}
+}
\ No newline at end of file