-
Notifications
You must be signed in to change notification settings - Fork 67
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
Implementing Cucumber Scenario. Exercise 1 #2
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Ninitha!
<artifactId>cucumber-java</artifactId> | ||
<version>6.9.1</version> | ||
<scope>test</scope> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful, you have this dependency twice - you only need the second one.
public List<Order_NB> getUrgentOrders() { | ||
List<Order_NB> results = new ArrayList<>(); | ||
for(int i=0;i<receivedOrders.size();i++) { | ||
if (receivedOrders.get(i).getOrderStatus()=="Urgent") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When comparing Strings in Java, don't forget to use the equals() method, e.g. if (receivedOrders.get(i).getOrderStatus().equals("Urgent"))
break; | ||
} | ||
} | ||
return receivedOrders.get(i).getOrderStatus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good but you'll learn easier ways to write this code later on in the course.
public void sarah_should_see_the_order_in_her_order_history() { | ||
assertThat(customer.getOrderHistoryFor(orderReceipt.getCustomerId())).contains(Order.matching(orderReceipt)); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
} | ||
|
||
public void completeOrder(OrderReceipt orderReceipt) { | ||
coffeeOrders.getOrders().stream().filter(order -> order.getCustomerId()==orderReceipt.getCustomerId()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would work if customerId was a number, but if it is a string it is better to use equals()
@wakaleo Ready For review