Expression lambdas
This commit is contained in:
parent
873f1911ac
commit
1273ae47fe
1 changed files with 4 additions and 12 deletions
|
|
@ -42,16 +42,12 @@ class RecipeTest {
|
||||||
@Test
|
@Test
|
||||||
void getIngredientsAddThrow() {
|
void getIngredientsAddThrow() {
|
||||||
// TODO: Change to actual Ingredient class later
|
// TODO: Change to actual Ingredient class later
|
||||||
assertThrows(UnsupportedOperationException.class, () -> {
|
assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().add("Lasagna"));
|
||||||
recipe.getIngredients().add("Lasagna");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getIngredientsClearThrow() {
|
void getIngredientsClearThrow() {
|
||||||
assertThrows(UnsupportedOperationException.class, () -> {
|
assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().clear());
|
||||||
recipe.getIngredients().clear();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -66,16 +62,12 @@ class RecipeTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getPreparationStepsAddThrow() {
|
void getPreparationStepsAddThrow() {
|
||||||
assertThrows(UnsupportedOperationException.class, () -> {
|
assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().add("Preheat Oven"));
|
||||||
recipe.getPreparationSteps().add("Preheat Oven");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getPreparationStepsClearThrow() {
|
void getPreparationStepsClearThrow() {
|
||||||
assertThrows(UnsupportedOperationException.class, () -> {
|
assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().clear());
|
||||||
recipe.getPreparationSteps().clear();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue