Expression lambdas

This commit is contained in:
Oskar Rasieński 2025-11-21 20:18:31 +01:00 committed by Steven Liu
commit 1273ae47fe

View file

@ -42,16 +42,12 @@ class RecipeTest {
@Test
void getIngredientsAddThrow() {
// TODO: Change to actual Ingredient class later
assertThrows(UnsupportedOperationException.class, () -> {
recipe.getIngredients().add("Lasagna");
});
assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().add("Lasagna"));
}
@Test
void getIngredientsClearThrow() {
assertThrows(UnsupportedOperationException.class, () -> {
recipe.getIngredients().clear();
});
assertThrows(UnsupportedOperationException.class, () -> recipe.getIngredients().clear());
}
@Test
@ -66,16 +62,12 @@ class RecipeTest {
@Test
void getPreparationStepsAddThrow() {
assertThrows(UnsupportedOperationException.class, () -> {
recipe.getPreparationSteps().add("Preheat Oven");
});
assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().add("Preheat Oven"));
}
@Test
void getPreparationStepsClearThrow() {
assertThrows(UnsupportedOperationException.class, () -> {
recipe.getPreparationSteps().clear();
});
assertThrows(UnsupportedOperationException.class, () -> recipe.getPreparationSteps().clear());
}
@Test