update
This commit is contained in:
@@ -38,6 +38,11 @@ public final class TestReservations {
|
||||
// 4. Request that Manager updates specific account’s files with data stored in
|
||||
// memory
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
Account acct2 = mgr.newAccount("301-356-3890",
|
||||
new Address("30 Amstadam ave", "New York", "NY", "12010"),
|
||||
new EmailAddress("newbee952@aol.com"));
|
||||
mgr.AddAccount(acct2);
|
||||
// 5. Add draft lodging reservation to an account (if reservation object already
|
||||
// exists with the same reservation number, it is considered an error)
|
||||
|
||||
@@ -50,12 +55,22 @@ public final class TestReservations {
|
||||
hotel.setSquareFeet(450);
|
||||
hotel.setReservation_start_date(ZonedDateTime.of(2025, 07, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
hotel.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success1 = mgr.addReservation(acct, hotel);
|
||||
assert success1;
|
||||
mgr.addReservation(acct, hotel);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
CabinReservation cabin = new CabinReservation(new Address("30 cabin ave", "Carnelian", "CA", "96140"));
|
||||
cabin.setMailing_address(new Address("30 cabin ave", "Carnelian Bay", "CA", "96140"));
|
||||
cabin.setNumberOfBeds(4);
|
||||
cabin.setNumberOfFloors(2);
|
||||
cabin.setNumberOfBedRooms(3);
|
||||
cabin.setSquareFeet(806);
|
||||
cabin.setReservation_start_date(ZonedDateTime.of(2025, 9, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
cabin.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
mgr.addReservation(acct2, cabin);
|
||||
mgr.UpdateAccount(acct2);
|
||||
|
||||
cabin = new CabinReservation(new Address("40 cabin ave", "Carnelian", "CA", "96140"));
|
||||
cabin.setMailing_address(new Address("40 cabin ave", "Carnelian Bay", "CA", "96140"));
|
||||
cabin.setNumberOfBeds(4);
|
||||
cabin.setNumberOfFloors(2);
|
||||
@@ -63,8 +78,7 @@ public final class TestReservations {
|
||||
cabin.setSquareFeet(806);
|
||||
cabin.setReservation_start_date(ZonedDateTime.of(2025, 9, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
cabin.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success2 = mgr.addReservation(acct, cabin);
|
||||
assert success2;
|
||||
mgr.addReservation(acct, cabin);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
@@ -77,8 +91,7 @@ public final class TestReservations {
|
||||
house.setSquareFeet(1400);
|
||||
house.setReservation_start_date(ZonedDateTime.of(2025, 9, 5, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
house.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success3 = mgr.addReservation(acct, house);
|
||||
assert success3;
|
||||
mgr.addReservation(acct, house);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user