Skip to content
Snippets Groups Projects
Commit 2b1e6356 authored by victorm's avatar victorm
Browse files

TrayectoTest Finalizado

parent fc5c0a84
No related branches found
No related tags found
No related merge requests found
......@@ -214,23 +214,6 @@ public class TrayectoTest {
new Trayecto(m1,p1,f1,m2,p2,f2);
}
@Test(expected = IllegalArgumentException.class)
public void testPrecioTrayectoEnEuros() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
GPSCoordinate c2 = new GPSCoordinate(10d,10d);
Muelle m1 = new Muelle ("01",c1,true,2,2);
Muelle m2 = new Muelle ("02",c2,false,2,2);
Puerto p1 = new Puerto ("ES","PAL");
Puerto p2 = new Puerto ("ES","VAL");
p1.anyadirMuelle(m1);
p2.anyadirMuelle(m2);
Fecha f1 = new Fecha (1,11,1999);
Fecha f2 = new Fecha (30,12,2000);
Trayecto t = new Trayecto (m1,p1,f1,m2,p2,f2);
t.precioTrayectoEnEuros(2,0);
}
@Test
public void testFechaFinTrayectoSuperior() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
......@@ -281,4 +264,65 @@ public class TrayectoTest {
double v = 781.1062793857914;
assertEquals(v, t.distanciaMillasMarinas(), 0.001);
}
@Test
public void testprecioTrayectoEurosBien() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
GPSCoordinate c2 = new GPSCoordinate(10d,10d);
Muelle m1 = new Muelle ("01",c1,true,2,2);
Muelle m2 = new Muelle ("01",c2,true,2,2);
Puerto p1 = new Puerto ("ES","BAR");
Puerto p2 = new Puerto ("AR","BUE");
p1.anyadirMuelle(m1);
p2.anyadirMuelle(m2);
Fecha f1 = new Fecha (9,11,2024);
Fecha f2 = new Fecha(11,11,2024);
Trayecto t = new Trayecto(m1,p1,f1,m2,p2,f2);
t.precioTrayectoEnEuros(5,5);
}
@Test(expected = IllegalArgumentException.class)
public void testprecioTrayectoEurosMalPrimero() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
GPSCoordinate c2 = new GPSCoordinate(10d,10d);
Muelle m1 = new Muelle ("01",c1,true,2,2);
Muelle m2 = new Muelle ("01",c2,true,2,2);
Puerto p1 = new Puerto ("ES","BAR");
Puerto p2 = new Puerto ("AR","BUE");
p1.anyadirMuelle(m1);
p2.anyadirMuelle(m2);
Fecha f1 = new Fecha (9,11,2024);
Fecha f2 = new Fecha(11,11,2024);
Trayecto t = new Trayecto(m1,p1,f1,m2,p2,f2);
t.precioTrayectoEnEuros(0,5);
}
@Test(expected = IllegalArgumentException.class)
public void testprecioTrayectoEurosMalSegundo() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
GPSCoordinate c2 = new GPSCoordinate(10d,10d);
Muelle m1 = new Muelle ("01",c1,true,2,2);
Muelle m2 = new Muelle ("01",c2,true,2,2);
Puerto p1 = new Puerto ("ES","BAR");
Puerto p2 = new Puerto ("AR","BUE");
p1.anyadirMuelle(m1);
p2.anyadirMuelle(m2);
Fecha f1 = new Fecha (9,11,2024);
Fecha f2 = new Fecha(11,11,2024);
Trayecto t = new Trayecto(m1,p1,f1,m2,p2,f2);
t.precioTrayectoEnEuros(5,0);
}
@Test
public void testinforTrayecto() {
GPSCoordinate c1 = new GPSCoordinate(5d,5d);
GPSCoordinate c2 = new GPSCoordinate(10d,10d);
Muelle m1 = new Muelle ("01",c1,true,2,2);
Muelle m2 = new Muelle ("01",c2,true,2,2);
Puerto p1 = new Puerto ("ES","BAR");
Puerto p2 = new Puerto ("AR","BUE");
p1.anyadirMuelle(m1);
p2.anyadirMuelle(m2);
Fecha f1 = new Fecha (9,11,2024);
Fecha f2 = new Fecha(11,11,2024);
Trayecto t = new Trayecto(m1,p1,f1,m2,p2,f2);
t.inforTrayecto();
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment