Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/ / Test AirportLog Find Airport by State and Country @Test public void test _ 1 0 _ 5 ( ) { Airport airport 1

// Test AirportLog Find Airport by State and Country
@Test
public void test_10_5(){
Airport airport1= new Airport("DTW, Detroit Metropolitan Airport, Detroit, MI, USA, 42.21206,-83.34884");
Airport airport2= new Airport("ACV, Arcata Airport,Arcata/Eureka, CA , USA ,40.97812,-124.10862");
Airport airport3= new Airport("AKN, King Salmon Airport, King Salmon, AK, USA, 58.6768,-156.64922");
Airport airport4= new Airport(
"CMI, University of Illinois - Willard Airport, Champaign/Urbana, IL, USA, 40.03925,-88.27806");
Airport airport5= new Airport(" MKG, Muskegon County Airport, Muskegon, MI, USA, 43.16949,-86.23822");
Airport airport6= new Airport(" MBS, MBS International Airport, Saginaw, MI, USA, 43.53291,-84.07965");
Airport airport7= new Airport(
" LAN, Capital Region International Airport( Lansing Capital City), Lansing, MI, USA, 42.7787,-84.58736");
Airport airport8= new Airport(" IMT, Ford Airport Iron, Mountain/Kingsford, MI, USA, 45.81835,-88.11454");
Airport airport9= new Airport(
" GRR, Gerald R. Ford International Airport, Grand Rapids, MI, USA, 42.88082,-85.52277");
Airport airport10= new Airport("FNT, Bishop International Airport, Flint, MI, USA, 42.9655,-83.74346");
Airport airport11= new Airport(" ESC, Delta County Airport, Escanaba, MI, USA, 45.72267,-87.09373");
Airport airport12= new Airport("BGM, Greater Binghamton Airport, Binghamton, NY, USA, 42.20848,-75.97961");
Airport airport13= new Airport(
"BUF, Buffalo Niagara International Airport, Buffalo, NY, USA, 42.94052,-78.73217");
ArrayList airports = new ArrayList<>();
airports.add(airport1);
airports.add(airport2);
airports.add(airport3);
airports.add(airport4);
airports.add(airport5);
airports.add(airport6);
airports.add(airport7);
airports.add(airport8);
airports.add(airport9);
airports.add(airport10);
airports.add(airport11);
airports.add(airport12);
AirportLog log = new AirportLog("Test Log1", airports);
AirportLog result = log.findAirport("AK", "USA");
assertEquals("Test AirportLog Find Airport by State and Country Failed", 1, result.size());
log.addAirport(airport13);
result = log.findAirport("NY", "USA");
assertEquals("Test AirportLog Find Airport by State and Country Failed", 2, result.size());
}
// Test AirportLog Find Airport by Index
@Test
public void test_10_6(){
Airport airport1= new Airport("DTW, Detroit Metropolitan Airport, Detroit, MI, USA, 42.21206,-83.34884");
Airport airport2= new Airport("ACV, Arcata Airport,Arcata/Eureka, CA , USA ,40.97812,-124.10862");
Airport airport3= new Airport("AKN, King Salmon Airport, King Salmon, AK, USA, 58.6768,-156.64922");
Airport airport4= new Airport(
"CMI, University of Illinois - Willard Airport, Champaign/Urbana, IL, USA, 40.03925,-88.27806");
Airport airport5= new Airport(" MKG, Muskegon County Airport, Muskegon, MI, USA, 43.16949,-86.23822");
Airport airport6= new Airport(" MBS, MBS International Airport, Saginaw, MI, USA, 43.53291,-84.07965");
Airport airport7= new Airport(
" LAN, Capital Region International Airport( Lansing Capital City), Lansing, MI, USA, 42.7787,-84.58736");
Airport airport8= new Airport(" IMT, Ford Airport Iron, Mountain/Kingsford, MI, USA, 45.81835,-88.11454");
Airport airport9= new Airport(
" GRR, Gerald R. Ford International Airport, Grand Rapids, MI, USA, 42.88082,-85.52277");
Airport airport10= new Airport("FNT, Bishop International Airport, Flint, MI, USA, 42.9655,-83.74346");
Airport airport11= new Airport(" ESC, Delta County Airport, Escanaba, MI, USA, 45.72267,-87.09373");
Airport airport12= new Airport("BGM, Greater Binghamton Airport, Binghamton, NY, USA, 42.20848,-75.97961");
Airport airport13= new Airport(
"BUF, Buffalo Niagara International Airport, Buffalo, NY, USA, 42.94052,-78.73217");
ArrayList airports = new ArrayList<>();
airports.add(airport1);
airports.add(airport2);
airports.add(airport3);
airports.add(airport4);
airports.add(airport5);
airports.add(airport6);
airports.add(airport7);
airports.add(airport8);
airports.add(airport9);
airports.add(airport10);
airports.add(airport11);
airports.add(airport12);
airports.add(airport13);
AirportLog log = new AirportLog("Test Log2", airports);
assertSame("Test AirportLog Find Airport by Index Failed", airport1, log.findAirport(0));
assertSame("Test AirportLog Find Airport by Index Failed", airport3, log.findAirport(2));
}
// Test AirportLog Find Airport by Index
@Test
public void test_10_7(){
Airport airport1= new Airport("DTW, Detroit Metropolitan Airport, Detroit, MI, USA, 42.21206,-83.34884");
Airport airport2= new Airport("ACV, Arcata Airport,Arcata/Eureka, CA , USA ,40.97812,-124.10862");
Airport airport3= new Airport("AKN, King Salmon Airport, King Salmon, AK, USA, 58.6768,-156.64922");
Airport airport4= new Airport(
"CMI, U

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

3-4 Discuss corporate social responsibility 4142

Answered: 1 week ago