Possible to add duplicate passages to story
Expected Behavior
An exception should be thrown when trying to add a passage to a story that already exists. It should not be possible to have several passages in a story with the same title.
Actual Behavior
At the moment nothing happens when a passage is added
Steps to Reproduce the Problem
- Create a new story object.
- Use the addPassage with a new passage object.
- Use the addPassage method again with a passage that has the same name as the one prior.
Proposed Solution (Optional)
Call the getPassages method and use the contains method on the retrieved list to check if it exists already. The equals method to the Passage class is in this case used. Add relevant tests for this.
Screenshots (If applicable)
Edited by Carl Gützkow