added IngredientControllerTest + fix comments
This commit is contained in:
parent
f7a1deb9b1
commit
9603742220
2 changed files with 3 additions and 3 deletions
|
|
@ -23,7 +23,7 @@ public class IngredientController {
|
|||
private final RestTemplate restTemplate = new RestTemplate(); // Simplified REST client
|
||||
|
||||
@FXML
|
||||
void handleDeleteIngredient(ActionEvent event) {
|
||||
public void handleDeleteIngredient(ActionEvent event) {
|
||||
// Get selected ingredient
|
||||
Ingredient selectedIngredient = ingredientListView.getSelectionModel().getSelectedItem();
|
||||
if (selectedIngredient == null) {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class IngredientControllerMockTest {
|
|||
|
||||
// pick ingredient -> backend says not in use -> fake delete ingredient
|
||||
@Test
|
||||
void deleteingredientwhennotusedcallsusagethendeleteandclearslist() throws Exception {
|
||||
void DeleteIngredientWhenNotUsedCallsUsageThenDeleteAndClearsList() throws Exception {
|
||||
Ingredient selected = ingredientListView.getItems().get(0);
|
||||
ingredientListView.getSelectionModel().select(selected);
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ class IngredientControllerMockTest {
|
|||
|
||||
//select ingredient -> if used backend says it and show warning -> safety delete but shouldn't happen
|
||||
@Test
|
||||
void deleteIngredientwhenUsedshowsWarningandDoesNotDeleteifDialogClosed() throws Exception {
|
||||
void DeleteIngredientWhenUsedShowsWarningAndDoesNotDeleteIfDialogClosed() throws Exception {
|
||||
Ingredient selected = ingredientListView.getItems().get(1);
|
||||
ingredientListView.getSelectionModel().select(selected);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue