Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Antonio Rueda
/
reserva-hoteles
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
e8f6ca7f
authored
Oct 02, 2024
by
Antonio Rueda
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Test unitario de reservas en Hotel
parent
fe1cb857
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
src/test/java/es/ujaen/dae/reservahoteles/entidades/TestHotel.java
src/test/java/es/ujaen/dae/reservahoteles/entidades/TestHotel.java
0 → 100644
View file @
e8f6ca7f
package
es
.
ujaen
.
dae
.
reservahoteles
.
entidades
;
import
java.time.LocalDate
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
org.junit.jupiter.api.Test
;
/**
*
* @author ajrueda
*/
public
class
TestHotel
{
@Test
void
testReserva
()
{
var
hotel
=
new
Hotel
(
1
,
"Gran Hotel Almería"
,
"Almería"
,
"Almería"
,
"04001"
,
25
,
50
,
100
,
180
);
var
cliente
=
new
Cliente
(
"Pedro"
,
"Jaén Jaén"
,
"611203025"
,
"pjaen@gmail.com"
,
"miClAvE"
);
var
reserva1
=
new
Reserva
(
1
,
cliente
,
LocalDate
.
now
().
plusDays
(
15
),
LocalDate
.
now
().
plusDays
(
17
),
0
,
1
);
hotel
.
nuevaReserva
(
reserva1
);
var
reserva2
=
new
Reserva
(
2
,
cliente
,
LocalDate
.
now
().
plusDays
(
30
),
LocalDate
.
now
().
plusDays
(
35
),
1
,
1
);
hotel
.
nuevaReserva
(
reserva2
);
// ARREGLAR PARA NO COMPARAR REFERENCIAS
assertThat
(
hotel
.
reservasEntre
(
LocalDate
.
now
().
plusDays
(
10
),
LocalDate
.
now
().
plusDays
(
20
))).
containsExactly
(
reserva1
);
assertThat
(
hotel
.
reservasEntre
(
LocalDate
.
now
().
plusDays
(
25
),
LocalDate
.
now
().
plusDays
(
40
))).
containsExactly
(
reserva2
);
}
}
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