Question
All input data are assumed valid, and thus we are not testing for invalid input data. This means that all the parameters of the test
All input data are assumed valid, and thus we are not testing for invalid input data. This means that all the parameters of the test methods should contain valid parameter values
Room types are: 1) RoomWBath, 2) RoomWView, 3) NormalRoom and they are all of type String
Room daily rates are: 1) RoomWBath -> [$200], 2) RoomWView -> [$175], 3) NormalRoom -> [$125]
The pattern for a Date variable as a string has this format: MMM dd, yyyy
All inputted reservation dates are valid. That is reservation end date > reservation start date
The Reservation class codes compiles without any syntax errors
We are not testing the methods of 1) updateReservaton() and 2) dropReservation() as their code is not ready yet for testing. They are not tested
These four sets of black-box functional tests were conducted:
Testing constructor & getters (test cases and screenshots of unit tests Java code and its results)
Testing setters & getters (test cases and unit tests Java code)
Testing calculateReservationNumberOfDays() (test cases and screenshots of unit tests Java code and its results)
Testing calculateReservationBillAmount() (test cases and screenshots of unit tests Java code and its results)
1. Testing constructor & getters (test cases and screenshots of unit tests Java code and its results)
Test case # | Selected Inputs guestID, roomType, startDate, endDate | Expected Result | Actual Result | Pass | Fail |
1 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" & 7, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | unique UUID reservationIDs | two unique UUID NOT equal to each other | Pass |
2 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | reservation date is todays date as a Java Date type with milliseconds | todays date as a Java Date type with milliseconds | Fail because of differences in millisecond when getting todays date |
3 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | reservation date is todays date using the MMM dd, yyyy pattern | todays date using the MMM dd, yyyy pattern | Pass |
4 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | guestID == 1 | 1 | Pass |
5 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | roomType == RoomWBath | RoomWBath | Pass |
6 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | startDate == Jun 16, 2022 | Jun 16, 2022 | Pass |
7 | 1, "RoomWBath", "Jun 16, 2022", "Jun 19, 2022" | endDate == "Jun 19, 2022" | "Jun 19, 2022" | Pass |
2. Testing setters & getters (test cases and screenshots of unit tests Java code and its results)
Test case # | Selected Inputs guestID, roomType, startDate, endDate | Expected Result | Actual Result | Pass | Fail |
1 | 7, "NormalRoom", "Jan 07, 2023", "Jan 17, 2023" & set guestID = 77 | guestID == 77 | 77 | Pass |
2 | 7, "NormalRoom", "Jan 07, 2023", "Jan 17, 2023" & set roomType = RoomWView | roomType == RoomWView | RoomWView | Pass |
3 | 7, "NormalRoom", "Jan 07, 2023", "Jan 17, 2023" & set startDate = Jan 10, 2023 | startDate = Jan 10, 2023 | Jan 07, 2023 | Fail fail because the setReservationStartDate() sets the endDate and not the startDate. Should look like this: this.reservationStartDate = newValue; |
4 | 7, "NormalRoom", "Jan 07, 2023", "Jan 17, 2023" & set endDate = Jan 15, 2023 | endDate = Jan 15, 2023 | Jan 15, 2023 | Pass |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started