flightunittest.java

来自「航班订座系统~java的作业」· Java 代码 · 共 41 行

JAVA
41
字号
public class FlightUnitTest
{
/* This class white box tests the flight class
and black bo tests objects of the Seat class
comment out code where appropriate.
*/
public static void main (String args[])
{
Flight aFlight = new Flight(6, 4);
// Test 1: Test of constructor and setter method
// for flight details
aFlight.setFlightDetails("S345", "GLA","SYY");
aFlight.displayFlightInfo();
aFlight.displaySeatingPlan();
/*
// Test 2: Update of seating plan and free,
// reserved and booked seats
aFlight.updateSeat("1A", "Smith", 1);
aFlight.updateSeat("1B", "Brown", 2);
aFlight.updateSeat("1C", "Jones", 2);
aFlight.displayFlightInfo();
aFlight.displaySeatingPlan();
// Test 3: Change flight status to checking in
aFlight.setFlightStatus('1');
aFlight.displayFlightInfo();
// Test 4: Change flight status to boarding
aFlight.setFlightStatus('2');
aFlight.displayFlightInfo();
// Test 5: Change flight status to closed
aFlight.setFlightStatus('3');
aFlight.displayFlightInfo();
// Test 6: View the details of a seat on the flight
aFlight.updateSeat("3C", "McDonald", 2);
aFlight.viewSeat("3C");
// Test 7: View the details of a seat on the flight
// invalid seat entered
aFlight.updateSeat("3D", "Murray", 2);
aFlight.viewSeat("3Z");
*/
}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?