mirror of
https://github.com/UnlegitDqrk/Potato.git
synced 2025-10-02 06:30:15 +02:00
Added different ways the potato can be not delicious!
This commit is contained in:
@@ -41,7 +41,7 @@ public class Potato implements Tuber {
|
||||
public void prepare() throws NotDeliciousException {
|
||||
this.addCondiments("sour cream", "chives", "butter", "crumbled bacon", "grated cheese", "ketchup", "salt", "tabasco");
|
||||
this.listCondiments();
|
||||
if (!this.isDelicious()) throw new NotDeliciousException();
|
||||
if (!this.isDelicious()) throw new NotDeliciousException(NotDeliciousReason.NOT_BAKED);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class Potato implements Tuber {
|
||||
public void addCondiments(String... names) throws NotDeliciousException {
|
||||
for (String condimentName : names) {
|
||||
Condiment condiment = new Condiment(condimentName, true);
|
||||
if (!condiment.isDelicious()) throw new NotDeliciousException();
|
||||
if (!condiment.isDelicious()) throw new NotDeliciousException(NotDeliciousReason.NOT_DELICIOUS_CONDIMENT);
|
||||
this.getCondiments().add(condiment);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user