-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBicicletaTest.java
More file actions
72 lines (64 loc) · 2.43 KB
/
Copy pathBicicletaTest.java
File metadata and controls
72 lines (64 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* Clase de pruebas de las bicicletas
*
* @author Alexeido, Thander y Natera
* @version 1.0
*/
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* The test class BicicletaTest.
*
* @author Alexeido, Thander y Natera
* @version 31-10-2022
*/
public class BicicletaTest
{
Bicicleta bicicleta1= new Bicicleta("TREK Madone SLR 9 eTap Gen 7",BicicletaPeso.LIGERA);
BicicletaRapida bicicleta2 = new BicicletaRapida("TREK Emonda SLR 9 eTap",BicicletaPeso.NORMAL, 0.5);
BicicletaPrototipo bicicleta3= new BicicletaPrototipo("TREK Domane SLR 9 eTap Gen 4",BicicletaPeso.PESADA);
Ciclista cliclista1 = new CiclistaNovato("WIEBES", CiclistaHabilidad.LENTA , 1190,new Equipo());
Ciclista cliclista2 = new CiclistaExperimentado("LIPPERT", CiclistaHabilidad.NORMAL, 1160,new Equipo());
Ciclista cliclista3 = new CiclistaEstrella("LABOUS", CiclistaHabilidad.BUENA, 1150,new Equipo());
Etapa etapa1 = new Etapa("sencilla larga", EtapaDificultad.NORMAL, EtapaDistancia.CORTA);
Etapa etapa2 = new Etapa("compleja intermedia", EtapaDificultad.SENCILLA, EtapaDistancia.INTERMEDIA);
Etapa etapa3 = new Etapa("normal intermedia", EtapaDificultad.COMPLEJA, EtapaDistancia.LARGA);
/**
* Default constructor for test class BicicletaTest
*/
public BicicletaTest()
{
}
/**
* Sets up the test fixture.
*
* Called before every test case method.
*/
@BeforeEach
public void setUp()
{
}
/**
* Tears down the test fixture.
*
* Called after every test case method.
*/
@AfterEach
public void tearDown()
{
}
@Test
public void testGetVelocidad(){
assertEquals(String.format("%.2f", bicicleta1.getVelocidad(etapa1,cliclista1)), "54,42");
assertEquals(String.format("%.2f", bicicleta2.getVelocidad(etapa2,cliclista2)), "89,39");
assertEquals(String.format("%.2f", bicicleta3.getVelocidad(etapa3,cliclista3)), "92,65");
}
@Test
public void testGetTime(){
assertEquals(String.format("%.2f", bicicleta1.getETime(etapa1,cliclista1)), "165,37");
assertEquals(String.format("%.2f", bicicleta2.getETime(etapa2,cliclista2)), "134,24");
assertEquals(String.format("%.2f", bicicleta3.getETime(etapa3,cliclista3)), "2,43");
}
}