| Statement Coverage | Branch Coverage | Loop Coverage | Strict Condition Coverage | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| private void onDelete(String fileId, String[] bookIds) | 3 / 3 | 100 % |
|
5 / 6 | 83 % |
|
1 / 3 | 33 % |
|
0 / 1 | 0 % |
|
| AppController.java | ||
|---|---|---|
| 91 | private void onDelete(String fileId, String[] bookIds) { | |
| 92 | if(bookIds.length == 0) { | |
| 93 | return; | |
| 94 | } | |
| 95 | ||
| 96 | int result = view.showConfirmationDialog( | |
| 97 | "Are you sure you want to delete these books?", fileId); | |
| 98 | switch (result) { | |
| 99 | case JOptionPane.YES_OPTION: | |
| 100 | for (String bookId : bookIds) { | |
| 101 | model.removeBookFromFile(fileId, bookId); | |
| 102 | } | |
| 103 | break; | |
| 104 | case JOptionPane.NO_OPTION: | |
| 105 | case JOptionPane.CANCEL_OPTION: | |
| 106 | } | |
| 107 | } | |