Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alvaro Ordóñez Romero
/
DAE-aha00026-aor00039
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c101bb7
authored
Oct 07, 2023
by
Alvaro Ordóñez Romero
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Tests de la clase Viaje
parent
d37a0945
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
1 deletions
src/test/java/com/carpooling/carpoolingaoraha/entidades/SistemaCarPoolingTests.java → src/test/java/com/carpooling/carpoolingaoraha/entidades/SistemaCarPoolingTest.java
src/test/java/com/carpooling/carpoolingaoraha/entidades/ViajeTest.java
src/test/java/com/carpooling/carpoolingaoraha/entidades/SistemaCarPoolingTest
s
.java
→
src/test/java/com/carpooling/carpoolingaoraha/entidades/SistemaCarPoolingTest.java
View file @
3c101bb7
...
@@ -9,7 +9,7 @@ import java.util.Date;
...
@@ -9,7 +9,7 @@ import java.util.Date;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
junit
.
Assert
.*;
public
class
SistemaCarPoolingTest
s
{
public
class
SistemaCarPoolingTest
{
private
SistemaCarPooling
sistema
;
private
SistemaCarPooling
sistema
;
@Before
@Before
...
...
src/test/java/com/carpooling/carpoolingaoraha/entidades/ViajeTest.java
0 → 100644
View file @
3c101bb7
package
com
.
carpooling
.
carpoolingaoraha
.
entidades
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.util.Date
;
import
static
org
.
junit
.
Assert
.*;
public
class
ViajeTest
{
private
Viaje
viaje
;
@Before
public
void
testConstructor
()
{
viaje
=
new
Viaje
(
"Origen"
,
"Destino"
,
new
Date
(),
3
,
20
);
}
@Test
public
void
testGetOrigen
()
{
assertEquals
(
"Origen"
,
viaje
.
getOrigen
());
}
@Test
public
void
testSetOrigen
()
{
viaje
.
setOrigen
(
"NuevoOrigen"
);
assertEquals
(
"NuevoOrigen"
,
viaje
.
getOrigen
());
}
@Test
public
void
testGetDestino
()
{
assertEquals
(
"Destino"
,
viaje
.
getDestino
());
}
@Test
public
void
testSetDestino
()
{
viaje
.
setDestino
(
"NuevoDestino"
);
assertEquals
(
"NuevoDestino"
,
viaje
.
getDestino
());
}
@Test
public
void
testGetFechaSalida
()
{
assertNotNull
(
viaje
.
getFechaSalida
());
}
@Test
public
void
testSetFechaSalida
()
{
Date
nuevaFecha
=
new
Date
();
viaje
.
setFechaSalida
(
nuevaFecha
);
assertEquals
(
nuevaFecha
,
viaje
.
getFechaSalida
());
}
@Test
public
void
testGetnAsientos
()
{
assertEquals
(
3
,
viaje
.
getnAsientos
());
}
@Test
public
void
testSetnAsientos
()
{
viaje
.
setnAsientos
(
4
);
assertEquals
(
4
,
viaje
.
getnAsientos
());
}
@Test
public
void
testGetPrecioAsiento
()
{
assertEquals
(
20
,
viaje
.
getPrecioAsiento
());
}
@Test
public
void
testSetPrecioAsiento
()
{
viaje
.
setPrecioAsiento
(
25
);
assertEquals
(
25
,
viaje
.
getPrecioAsiento
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment