Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Andrés Rojas Ortega
/
PR5_DS
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
c91566f2
authored
Dec 23, 2022
by
Andrés Rojas Ortega
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Cambios menores
parent
8ca2e0e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletions
prueba/src/test/java/com/mycompany/Modelo/GestorPrestamosTest.java
prueba/src/test/java/com/mycompany/Modelo/GestorPrestamosTest.java
View file @
c91566f2
...
@@ -52,7 +52,7 @@ public class GestorPrestamosTest {
...
@@ -52,7 +52,7 @@ public class GestorPrestamosTest {
public
void
testRegistrarFechaDevolucionPrestamoIdIgualZero
()
{
public
void
testRegistrarFechaDevolucionPrestamoIdIgualZero
()
{
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
String
mensajeConfirmacion
=
gestorPrestamos
.
registrarFechaDevolucion
(
-
1
,
LocalDate
.
of
(
2022
,
Month
.
DECEMBER
,
26
));
String
mensajeConfirmacion
=
gestorPrestamos
.
registrarFechaDevolucion
(
0
,
LocalDate
.
of
(
2022
,
Month
.
DECEMBER
,
26
));
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"ID del préstamo debe ser superior a 0"
);
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"ID del préstamo debe ser superior a 0"
);
}
}
...
@@ -71,6 +71,19 @@ public class GestorPrestamosTest {
...
@@ -71,6 +71,19 @@ public class GestorPrestamosTest {
}
}
@Test
@Test
public
void
testRegistrarFechaDevolucionFechaDevolucionIgualFechaTope
()
{
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
Prestamo
prestamo
=
new
Prestamo
(
1
,
LocalDate
.
of
(
2022
,
Month
.
DECEMBER
,
30
),
LocalDate
.
of
(
2023
,
Month
.
JANUARY
,
3
));
gestorPrestamos
.
crearPrestamo
(
prestamo
);
String
mensajeConfirmacion
=
gestorPrestamos
.
registrarFechaDevolucion
(
1
,
LocalDate
.
of
(
2023
,
Month
.
JANUARY
,
3
));
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"Fecha de devolución registrada"
);
}
@Test
public
void
testRegistrarFechaDevolucionFechaDevolucionPasada
()
{
public
void
testRegistrarFechaDevolucionFechaDevolucionPasada
()
{
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
...
@@ -82,5 +95,18 @@ public class GestorPrestamosTest {
...
@@ -82,5 +95,18 @@ public class GestorPrestamosTest {
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"La fecha introducida debe ser actual o futura"
);
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"La fecha introducida debe ser actual o futura"
);
}
}
@Test
public
void
testRegistrarFechaDevolucionFechaDevolucionFutura
()
{
GestorPrestamos
gestorPrestamos
=
new
GestorPrestamos
();
Prestamo
prestamo
=
new
Prestamo
(
1
,
LocalDate
.
of
(
2022
,
Month
.
DECEMBER
,
30
),
LocalDate
.
of
(
2023
,
Month
.
JANUARY
,
3
));
gestorPrestamos
.
crearPrestamo
(
prestamo
);
String
mensajeConfirmacion
=
gestorPrestamos
.
registrarFechaDevolucion
(
1
,
LocalDate
.
of
(
2023
,
Month
.
DECEMBER
,
2
));
Assertions
.
assertThat
(
mensajeConfirmacion
).
isEqualTo
(
"La fecha introducida debe ser actual o futura"
);
}
}
}
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