Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group 5: Refactoring #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

j-gassner
Copy link
Collaborator

Implementation of class hierarchy for aircrafts and according changes in other classes

@PtrBld PtrBld changed the title Group 5 Refactoring Group 5: Refactoring Nov 23, 2021
@@ -96,7 +96,7 @@ void thenTheBookingShouldBeStopped() throws NoSuchFieldException {
ScheduledFlight scheduledFlight = schedule.searchScheduledFlight(flight.getNumber());
assertThrows(IllegalStateException.class, () -> customer.createOrder(Arrays.asList("Amanda", "Max"), Arrays.asList(scheduledFlight), 180));
assertEquals(3, scheduledFlight.getPassengers().size());
assertEquals(4, scheduledFlight.getCapacity());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after the presentation today, I would prefer the old solution here :)

@@ -30,19 +31,6 @@ public ScheduledFlight(int number, Airport departure, Airport arrival, Identifie
this.currentPrice = currentPrice;
}

public int getCrewMemberCapacity() throws NoSuchFieldException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would keep the function but call the method of aircraft

} else if (this.aircraft instanceof Helicopter) {
model = ((Helicopter) this.aircraft).getModel();
} else if (this.aircraft instanceof PassengerDrone) {
model = "HypaHype";
} else {
throw new IllegalArgumentException(String.format("Aircraft is not recognized"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a separate commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants