We need to update the History class to ensure that entries are not added to the history unless the main data is loaded and a Zettel is displayed. Additionally, the History class should interact with the Display class instead of directly with ZettelkastenView.
Tasks:
Update the History class to:
Check if main data is loaded and a Zettel is displayed before adding to history.
Interact with the Display class for these checks.
Ensure the Display class provides the necessary methods (isMainDataLoaded and getDisplayedZettel).
Update CRC cards to reflect these changes.
Write TestNG test cases to cover the new behavior:
Test adding to history when main data is not loaded.
Test adding to history when main data is loaded but no Zettel is displayed.
Test adding to history when both conditions are met.
Test avoiding duplicates in history.
Acceptance Criteria:
History is only updated when main data is loaded and a Zettel is displayed.
Tests cover all specified scenarios.
CRC cards accurately reflect the new class interactions.
We need to update the
History
class to ensure that entries are not added to the history unless the main data is loaded and a Zettel is displayed. Additionally, theHistory
class should interact with theDisplay
class instead of directly withZettelkastenView
.Tasks:
History
class to:Display
class for these checks.Display
class provides the necessary methods (isMainDataLoaded
andgetDisplayedZettel
).Acceptance Criteria: