Answered step by step
Verified Expert Solution
Question
1 Approved Answer
To complete this assignment: 1 ) Create four ( 4 ) sets of black - box functional unit test cases and unit tests to test
To complete this assignment:
Create four sets of blackbox functional unit test cases and unit tests to test the following public components of the Reservation class:
a The constructor & getters methods
b The setters & getters methods
c The calculateReservationNumberOfDays method
d The calculateReservationBillAmount method
For each of these four sets complete the following:
a Create a set of blackbox functional unit test cases composed of Selected Inputs, Expected Result, Actual Result, PassFail to test the designated public components of the Reservation Class.
b Using the provided jar file, code Java unit tests to execute your test cases and record their PassFail verdicts for the designated public components of the Reservation class.
On the Java command line, compile and execute your single test file eg TestReservation.java using this single java command note that you need to specify the java extension for your single test file:
java cp wjar TestReservation.java
c Explain your approach to blackbox unit test designated public components of the Reservation class, the steps you followed to create it and the rationale behind your test cases and their results.
Importing the jar file provided for the assignment just ends with me receiving the error that import cannot be resolved.
import wAssert;
public class TestReservation
public static void mainString args
Constructor and getter methods
Reservation new Reservation "John Doe", ;
Assert.assertEquals rlgetGuestID;
Assert.assertEquals John Doe", rlgetName;
Assert.assertEquals rlgetStartDate ;
Assert.assertEquals rlgetEndDate ;
Setter and getter methods
rlsetGuestID;
Assert.assertEquals rlgetGuestID;
rlsetName Jane Doe";
Assert.assertEquals Jane Doe", rlgetName ;
rlsetStartDate ;
Assert.assertEquals rlgetStartDate ;
rlsetEndDate ;
Assert.assertEquals rlgetEndDate ;
Method to calculate the number of days reserved
Assert.assertEquals rlcalculateReservationNumDays ;
Method to calculate the bill for the reserved number of days
Assert.assertEquals rlcalculateReservationBillAmount ;
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